← Back to Skills Marketplace
ugpoor

Baidu Pan Upload

by superStupidBear · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
86
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install baidu-pan-upload-skill
Description
百度网盘文件上传,支持分片上传、断点续传和进度监控。触发词:百度网盘上传、baidu pan upload、上传文件到网盘、upload to baidu pan、断点续传。适用场景:(1)上传本地文件到百度网盘指定目录 (2)大文件自动分片上传 (>4MB) (3)中断后断点续传 (4)自动创建远程目录。
README (SKILL.md)

百度网盘文件上传

前提

已有百度网盘开放平台授权(access_token有效),.env文件含AccessToken、AppKey、SecretKey。

先用 baidu-pan-per-auth-skill 完成授权获取token。

上传文件

python3 scripts/upload.py \x3Clocal_file> \x3Cremote_dir> \x3Cenv_path> [--overwrite]

参数

参数 说明
local_file 本地文件路径
remote_dir 网盘远程目录(如 /docker镜像/备份
env_path .env文件路径(含AccessToken等凭据)
--overwrite 覆盖同名文件(默认不覆盖)

上传流程

所有文件统一走 precreate → superfile2(tmpfile) × N → create 流程:

  • ≤4MB → 1片快速上传
  • >4MB → 自动分片(每片4MB),计算每片MD5校验

断点续传

上传中断后,重新运行相同命令即可自动续传:

  1. 上传状态自动保存在源文件同目录下的 .upload_state.json
  2. 重启时检测:文件MD5未变 → 跳过已上传分片 → 从断点继续
  3. Ctrl+C 安全中断,状态自动保存
  4. 上传完成后自动删除状态文件

进度监控

大文件上传时实时显示:

  [████████████░░░░░░░░] 60.0% | 1.1GB/1.9GB | 3.2MB/s | ETA 4m12s

示例

# 上传单个文件
python3 scripts/upload.py /tmp/report.pdf "/文档" /path/to/.env

# 上传大文件(自动分片+进度监控+断点续传)
python3 scripts/upload.py /backup/data.zip "/备份" /path/to/.env

# 覆盖已有文件
python3 scripts/upload.py /tmp/config.json "/配置" /path/to/.env --overwrite

# 中断后续传(重新运行相同命令即可)
python3 scripts/upload.py /backup/data.zip "/备份" /path/to/.env

关键参数

参数 说明
分片大小 4MB 百度网盘API限制
上传域名 d.pcs.baidu.com 分片上传专用域名
重试次数 3 每个分片失败后重试
远程路径格式 /开头 /docker镜像
状态文件 .upload_state.json 保存在源文件同目录

故障排查

错误 原因 解决
errno: 2 路径格式错误 确保以 / 开头
error_code: 31023 token过期或uploadid过期 baidu-pan-per-auth-skill 刷新token
error_code: 31064 文件已存在 --overwrite 覆盖
SSL/超时 网络波动 自动重试3次
上传中断 Ctrl+C或网络断开 重新运行相同命令,自动断点续传
续传失败 源文件已变更 删除 .upload_state.json 重新上传

依赖

  • curl(系统自带)
  • Python 3.7+
  • 有效的百度网盘access_token
Usage Guidance
This skill appears to implement the advertised Baidu Netdisk upload features, but review and caution are advised before use: (1) The registry metadata fails to declare the required credentials (AppKey/access_token) and the SKILL.md expects a .env path — confirm you provide only a valid token and store the .env securely. (2) The script calls curl with the access_token in the full URL passed to subprocess.run; on multi-user systems this can leak the token via process listings (ps). Consider running in a single-user or isolated environment or modify the script to avoid embedding secrets in process arguments (use HTTP headers or a library-based multipart upload). (3) The Python code contains sloppy bugs (e.g., precreate uses md5_of_file(remote_path) instead of the source file, an undefined variable 'res' appears later) — run tests with small non-sensitive files first and consider fixing these bugs or asking the author for a corrected release. (4) The script writes .upload_state.json alongside source files; ensure correct file permissions and delete it if it contains sensitive metadata you don't want to keep. If you are not comfortable auditing/fixing the script yourself, prefer an official or well-reviewed client.
Capability Analysis
Type: OpenClaw Skill Name: baidu-pan-upload-skill Version: 1.1.0 The skill provides a legitimate utility for uploading files to Baidu Pan, supporting large file chunking and resume functionality. The core logic in `scripts/upload.py` implements the standard Baidu Pan API flow (precreate, upload chunks via curl, and merge) and manages upload states locally in a `.upload_state.json` file. While there is a minor coding error in the `precreate_file` function (attempting to MD5 a remote path string), it is immediately deleted and does not impact security. The script uses system `curl` safely via subprocess list arguments, and no evidence of data exfiltration to unauthorized endpoints or malicious prompt injection was found.
Capability Assessment
Purpose & Capability
The name/description (Baidu Pan uploader with chunking, resume, progress) matches the included script and SKILL.md. However the registry metadata declares no required env vars or binaries while SKILL.md and the script clearly require a .env with AppKey/AccessToken and the presence of curl/Python — this metadata omission is an inconsistency.
Instruction Scope
Runtime instructions are narrowly scoped to uploading a specified local file to a specified remote path and require a .env file path. The agent/script reads the provided local file, writes a .upload_state.json alongside it, and calls Baidu APIs. There is no instruction to read unrelated system files or exfiltrate data to third-party endpoints.
Install Mechanism
No install spec is present (instruction-only plus a Python script). That is low-risk from an installation perspective — nothing is downloaded at install time.
Credentials
The script requires sensitive credentials (access_token, AppKey) provided via a .env file but the skill registry does not declare these required env vars. Implementation detail: the script invokes curl with the access_token included in the URL passed as a subprocess argument, which may expose the token to other local users via process listings (ps). Saving file MD5 and paths in .upload_state.json is expected for resume but is local persistent data the user should be aware of.
Persistence & Privilege
always is false and the skill does not request system-wide persistence or modify other skills. It writes a local state file next to the uploaded file (expected behavior).
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install baidu-pan-upload-skill
  3. After installation, invoke the skill by name or use /baidu-pan-upload-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
- 新增断点续传功能,上传中断后可自动从断点继续,无需重新上传已完成分片 - 增加大文件上传进度监控,实时显示进度、速率与剩余时间 - 所有上传统一采用分片流程,提升大文件和小文件一致性 - 上传状态保存在源文件目录,上传完成后自动清理 - 文档补充了断点续传和进度监控的详细指引
v1.0.0
Initial release: single-file and chunked upload to Baidu Pan via API. Auto-chunking for files >4MB, auto-create remote directory, retry on failure. Requires baidu-pan-per-auth-skill for auth.
Metadata
Slug baidu-pan-upload-skill
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Baidu Pan Upload?

百度网盘文件上传,支持分片上传、断点续传和进度监控。触发词:百度网盘上传、baidu pan upload、上传文件到网盘、upload to baidu pan、断点续传。适用场景:(1)上传本地文件到百度网盘指定目录 (2)大文件自动分片上传 (>4MB) (3)中断后断点续传 (4)自动创建远程目录。 It is an AI Agent Skill for Claude Code / OpenClaw, with 86 downloads so far.

How do I install Baidu Pan Upload?

Run "/install baidu-pan-upload-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Baidu Pan Upload free?

Yes, Baidu Pan Upload is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Baidu Pan Upload support?

Baidu Pan Upload is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Baidu Pan Upload?

It is built and maintained by superStupidBear (@ugpoor); the current version is v1.1.0.

💬 Comments