Install
openclaw skills install aria2使用 aria2 下载磁力链接、种子、HTTP 文件。下载完成后自动转存到 115 网盘并删除本地文件。当用户发送磁力链接(magnet:)、种子文件(.torrent)、或要求下载文件时触发此 skill。
openclaw skills install aria2aria2 以 daemon 模式运行,通过 RPC 接口管理任务。
aria2.conf 路径<YOUR_RPC_SECRET> 或配置环境变量# 请将 <YOUR_RPC_SECRET> 替换为实际密钥
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.addUri","params":["token:e603c18b871468e81ec2b2458d3356e5",["<URL>"]]}'
# 先 base64 编码
TORRENT_B64=$(base64 -w0 /path/to/file.torrent)
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d "{\"jsonrpc\":\"2.0\",\"id\":\"1\",\"method\":\"aria2.addTorrent\",\"params\":[\"token:e603c18b871468e81ec2b2458d3356e5\",\"$TORRENT_B64\"]}"
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.tellActive","params":["token:e603c18b871468e81ec2b2458d3356e5"]}' | jq '.result[] | {gid, status, completedLength, totalLength, downloadSpeed, files: [.files[].path]}'
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.tellStatus","params":["token:e603c18b871468e81ec2b2458d3356e5","<GID>"]}' | jq '{status, completedLength, totalLength, downloadSpeed}'
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.tellWaiting","params":["token:e603c18b871468e81ec2b2458d3356e5",0,10]}'
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.tellStopped","params":["token:e603c18b871468e81ec2b2458d3356e5",0,10]}'
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.pause","params":["token:e603c18b871468e81ec2b2458d3356e5","<GID>"]}'
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.unpause","params":["token:e603c18b871468e81ec2b2458d3356e5","<GID>"]}'
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.remove","params":["token:e603c18b871468e81ec2b2458d3356e5","<GID>"]}'
本 Skill 需要配合主机端的自动转存脚本使用。建议在 aria2.conf 中配置 on-download-complete 钩子。
# 检查 aria2 daemon 是否运行
curl -s http://localhost:6800/jsonrpc -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":"1","method":"aria2.getVersion","params":["token:e603c18b871468e81ec2b2458d3356e5"]}'
## 快速命令格式
用户发送类似以下格式时直接添加下载:
- `/aria2 magnet:?xt=urn:btih:...`
- `/aria2 https://example.com/file.zip`
- `下载这个磁力 magnet:?xt=...`