← 返回 Skills 市场
ugpoor

Baidu Pan Upload

作者 superStupidBear · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ⚠ suspicious
86
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install baidu-pan-upload-skill
功能描述
百度网盘文件上传,支持分片上传、断点续传和进度监控。触发词:百度网盘上传、baidu pan upload、上传文件到网盘、upload to baidu pan、断点续传。适用场景:(1)上传本地文件到百度网盘指定目录 (2)大文件自动分片上传 (>4MB) (3)中断后断点续传 (4)自动创建远程目录。
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install baidu-pan-upload-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /baidu-pan-upload-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug baidu-pan-upload-skill
版本 1.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Baidu Pan Upload 是什么?

百度网盘文件上传,支持分片上传、断点续传和进度监控。触发词:百度网盘上传、baidu pan upload、上传文件到网盘、upload to baidu pan、断点续传。适用场景:(1)上传本地文件到百度网盘指定目录 (2)大文件自动分片上传 (>4MB) (3)中断后断点续传 (4)自动创建远程目录。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 86 次。

如何安装 Baidu Pan Upload?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install baidu-pan-upload-skill」即可一键安装,无需额外配置。

Baidu Pan Upload 是免费的吗?

是的,Baidu Pan Upload 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Baidu Pan Upload 支持哪些平台?

Baidu Pan Upload 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Baidu Pan Upload?

由 superStupidBear(@ugpoor)开发并维护,当前版本 v1.1.0。

💬 留言讨论