Config Tracker
自动检测并提交 OpenClaw 配置与工作区文件变更,实现零手动操作。
下载 642
支持断点续传的HTTP/HTTPS大文件下载,带进度监控和超时控制。
openclaw skills install @moony320/download-file命令、参数、文件名以原文为准
在从 HTTP/HTTPS URL 下载文件时使用此技能,特别是大文件(>100MB)。
典型场景:
触发关键词:
curl -C - 实现可恢复下载--progress-bar 标志exec(
command="curl -L -C - --progress-bar -o <destination_path> <URL>",
background=true,
timeout=600
)参数说明:
-L - 跟随重定向-C - - 恢复部分下载--progress-bar - 显示进度条-o - 输出文件路径background=true - 关键! 在后台运行以避免超时timeout=600 - 10 分钟超时(根据文件大小调整)process(action="poll", sessionId="<session_id>")定期轮询以检查下载进度,直到完成。
exec(command="ls -lh <file_path>")检查:
用户: "下载 https://github.com/example/app/releases/download/v1.0/app.dmg"
代理操作:
{
"tool": "exec",
"command": "curl -L -C - --progress-bar -o ~/Downloads/app.dmg https://github.com/example/app/releases/download/v1.0/app.dmg",
"background": true,
"timeout": 600
}返回: {status: "running", sessionId: "xxx"}
然后定期轮询:
{
"tool": "process",
"action": "poll",
"sessionId": "xxx"
}下载完成后验证:
{
"tool": "exec",
"command": "ls -lh ~/Downloads/app.dmg && file ~/Downloads/app.dmg"
}对于小文件,可接受简化处理:
exec(command="curl -L -o ~/Downloads/small.pdf https://example.com/small.pdf", timeout=120)小文件可同步运行,但仍需设置超时。
| 文件大小 | 推荐超时时间 |
|---|---|
| < 50MB | 120 秒(2 分钟) |
| 50-200MB | 300 秒(5 分钟) |
| 200-500MB | 600 秒(10 分钟) |
| 500MB-1GB | 1200 秒(20 分钟) |
| > 1GB | 1800 秒(30 分钟)或更长 |
1. 下载中断
# 重新运行相同命令,curl -C - 会自动续传
curl -L -C - --progress-bar -o file.zip <URL>2. 权限不足
# 确保目标目录可写
mkdir -p ~/Downloads3. 重定向失败
# 使用 -L 标志跟随重定向
curl -L -o file.zip <URL>4. 网络超时
# 增加超时时间或使用 --retry
curl -L --retry 3 --connect-timeout 30 -o file.zip <URL>如果系统中存在 aria2,可使用多线程加速下载:
exec(
command="aria2c -x 16 -s 16 -k 1M --continue -o ~/Downloads/file.zip <URL>",
background=true,
timeout=600
)# 1. 启动下载
exec(command="curl -L -C - --progress-bar -o ~/Downloads/file.zip <URL>", background=true, timeout=600)
# 2. 每 30 秒轮询一次
process(action="poll", sessionId="xxx")
# 3. 完成后验证
exec(command="ls -lh ~/Downloads/file.zip")
# 4. 可选:计算校验和
exec(command="md5sum ~/Downloads/file.zip")file 命令确认feishu-send-file - 将下载的文件发送至飞书file-read - 读取下载文件内容video-frames - 若为视频文件,提取帧若下载失败,请按以下步骤排查:
curl -I <URL> df -h ~/Downloads curl -v -o /dev/null <URL> wget --continue <URL>**记住:大文件下载时务必使用 background=true!** 🎯
已收录 1 个 Skill