Baidu Disk Helper (百度网盘) Open API Skill
This skill allows OpenClaw to interact with a user's Baidu Wangpan using the official Baidu Open API.
⚠️ Important: Bring Your Own Key (BYOK)
Baidu Netdisk strictly limits API access.
You MUST apply for your own developer keys to use this skill. The skill uses your keys to run locally and never sends them anywhere else.
1. Register a Baidu Developer App
- 1. Go to the Baidu Netdisk Open Platform.
- Register as a developer and create a new application (Software App / 软件应用).
- Obtain your AppKey (Client ID) and SecretKey (Client Secret).
2. Tell the Agent to Authenticate
Once you have your keys, tell your OpenClaw agent:
"I want to set up Baidu Wangpan. My AppKey is XXX and my SecretKey is YYY."
The agent will run the setup script and generate a URL for you. Click the URL, log into Baidu, copy the Authorization Code, and paste it back to the agent:
"Here is my authorization code: ZZZ"
Tokens are securely saved in ~/.openclaw/workspace/bwp_config.json.
🚀 Usage Guide for OpenClaw Agents
When the user asks you to interact with Baidu Wangpan, use the exec tool to run the following Python commands:
Setup & Auth
CODEBLOCK0
Storage & Listing
CODEBLOCK1
Download
# Get Download Link (requires FS_ID from list or search)
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py download "1054668475058405"
Note: Baidu enforces that the download request must include the header User-Agent: pan.baidu.com. The script will output an exact curl command you can run to download the file.
File Management
CODEBLOCK3
Upload
CODEBLOCK4
技能名称: baidu-disk-helper
详细描述:
百度网盘助手 Open API 技能
该技能允许 OpenClaw 通过百度官方开放 API 与用户的百度网盘进行交互。
⚠️ 重要提示:自带密钥(BYOK)
百度网盘严格限制 API 访问权限。
您必须自行申请开发者密钥才能使用此技能。 该技能在本地使用您的密钥运行,绝不会将密钥发送到其他地方。
1. 注册百度开发者应用
- 1. 访问百度网盘开放平台。
- 注册成为开发者并创建一个新应用(软件应用)。
- 获取您的 AppKey(客户端 ID)和 SecretKey(客户端密钥)。
2. 告知智能体进行身份验证
获取密钥后,请告知您的 OpenClaw 智能体:
我想设置百度网盘。我的 AppKey 是 XXX,SecretKey 是 YYY。
智能体将运行设置脚本并为您生成一个 URL。点击该 URL,登录百度,复制 授权码,然后将其粘贴回智能体:
这是我的授权码:ZZZ
令牌将安全保存在 ~/.openclaw/workspace/bwp_config.json 中。
🚀 OpenClaw 智能体使用指南
当用户要求您与百度网盘交互时,请使用 exec 工具运行以下 Python 命令:
设置与认证
bash
步骤 1:生成授权 URL
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py auth --app-key APP
KEY --secret-key SECRETKEY
步骤 2:验证授权码
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py auth --code AUTH_CODE
存储与列表
bash
查看配额
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py quota
列出文件
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py list --dir /apps
搜索文件(返回 FS_ID)
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py search 关键词 --dir /
下载
bash
获取下载链接(需要从列表或搜索中获取 FS_ID)
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py download 1054668475058405
注意:百度要求下载请求必须包含 User-Agent: pan.baidu.com 标头。脚本将输出一个完整的 curl 命令,您可以直接运行该命令下载文件。
文件管理
bash
创建目录
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py mkdir /apps/my
newfolder
重命名文件/目录(新名称仅为名称,非完整路径)
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py rename /apps/old
name.txt newname.txt
移动文件/目录
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py move /apps/file.txt /apps/my
newfolder
删除文件/目录(移至回收站)
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py delete /apps/file
todelete.txt
上传
bash
上传单个文件
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py upload /local/path/to/file.txt /apps/remote_folder
上传整个目录(使用多线程提升速度!)
python ~/.openclaw/workspace/skills/baidu-wangpan/scripts/bwp.py upload /local/path/to/directory /apps/remote_folder