Agent Skillsdtyq/magic › download

download

GitHub

通过SDK工具可靠下载外部HTTP/HTTPS文件,支持批量并发、断点续传及自定义请求头。

backend/super-magic/agents/skills/download/SKILL.md dtyq/magic

触发场景

需要下载单个或大量外部资源文件 涉及大文件或视频等长时间传输场景 需要处理断点续传或特殊HTTP头

安装

npx skills add dtyq/magic --skill download -g -y
更多选项

非标准路径

npx skills add https://github.com/dtyq/magic/tree/master/backend/super-magic/agents/skills/download -g -y

不安装直接使用

npx skills use dtyq/magic@download

指定 Agent (Claude Code)

npx skills add dtyq/magic --skill download -a claude-code -g -y

安装 repo 全部 skill

npx skills add dtyq/magic --all -g -y

预览 repo 内 skill

npx skills add dtyq/magic --list

SKILL.md

Frontmatter
{
    "name": "download",
    "description": "Use when external HTTP or HTTPS files must be downloaded reliably into the workspace, especially for multiple files, large videos or archives, resumable transfers, custom Referer or Origin headers, or downloads that may take a long time."
}

Download

Use download_from_urls through Code Mode with run_sdk_snippet. Use the same tool for one or multiple files. It handles batch concurrency, progress, retries, transfer timeouts, partial files, and HTTP Range internally.

Normal Call

Usually pass only url and file_path:

from sdk.tool import tool

result = tool.call("download_from_urls", {
    "downloads": [
        {
            "url": "https://example.com/media/video.mp4",
            "file_path": "media/video.mp4",
        },
        {
            "url": "https://example.com/data/archive.zip",
            "file_path": "data/archive.zip",
        },
    ],
})
print(result.content)

Always check result.ok and read result.content. A batch may contain both successful and failed items, so keep the full summary.

Request Headers

Omit headers by default. The download engine automatically sends browser-compatible headers and a same-origin Referer. If a first request receives a likely source-validation rejection, it retries once with a same-origin Origin.

Provide headers only when the task already supplies a more accurate access context:

result = tool.call("download_from_urls", {
    "downloads": [{
        "url": "https://cdn.example.com/assets/report.pdf",
        "file_path": "reports/report.pdf",
        "headers": {
            "Referer": "https://www.example.com/reports/latest",
            "Origin": "https://www.example.com",
        },
    }],
})
print(result.content)
  • Use a full page URL for Referer and only its scheme plus host for Origin.
  • Pass Cookie or Authorization only when the user explicitly provided the value for this download.
  • Never invent credentials or attempt to bypass login, CAPTCHA, WAF, DRM, or access controls.

Existing Files

overwrite defaults to true and is normally omitted. Set it to false only when the user wants to keep an existing complete target file.

If the requested destination may contain user-authored content and overwrite intent is unclear, call ask_user before starting Code Mode. ask_user cannot be called from inside a run_sdk_snippet script. Do not ask again when the user explicitly requested that destination or requested a replacement download.

Resume Behavior

On a recoverable failure, repeat the same url, file_path, and headers. The engine finds the preserved partial state and resumes automatically when the server supports HTTP Range. If the server does not safely support the saved range, the engine restarts that file without appending incompatible bytes.

Do not:

  • read or pass internal .part or .part.meta paths;
  • calculate offsets or send Range or If-Range;
  • create resume tokens;
  • pass download timeout, retry, concurrency, or chunk-size controls;
  • change the destination path when the intent is to resume the same file.

When a failed item reports next action: retry_same_request, retry the unchanged item. If it reports review_request, inspect the URL, destination, or required access context before retrying.

版本历史

  • f9973c5 当前 2026-08-20 03:37

同 Skill 集合

backend/super-magic/agents/skills/agent-info/SKILL.md
backend/super-magic/agents/skills/canvas-designer/SKILL.md
backend/super-magic/agents/skills/chat-history/SKILL.md
backend/super-magic/agents/skills/cli-manager/SKILL.md
backend/super-magic/agents/skills/compact-chat-history/SKILL.md
backend/super-magic/agents/skills/creating-slides/SKILL.md
backend/super-magic/agents/skills/develop-data-analysis-dashboard/SKILL.md
backend/super-magic/agents/skills/document-converter/SKILL.md
backend/super-magic/agents/skills/env-manager/SKILL.md
backend/super-magic/agents/skills/im-channels/SKILL.md
backend/super-magic/agents/skills/magic-calendar/SKILL.md
backend/super-magic/agents/skills/magicbase/SKILL.md
backend/super-magic/agents/skills/sandbox-manager/SKILL.md
backend/super-magic/agents/skills/self-media-pre-publish-analyzer/SKILL.md
backend/super-magic/agents/skills/share/SKILL.md
backend/super-magic/agents/skills/skill-vetter/SKILL.md
backend/super-magic/agents/skills/slide-template/SKILL.md
backend/super-magic/agents/skills/subagents/SKILL.md
backend/super-magic/agents/skills/teamshare-cli/SKILL.md
backend/super-magic/agents/skills/user-info/SKILL.md
backend/super-magic/agents/skills/using-cron/SKILL.md
backend/super-magic/agents/skills/using-llm/SKILL.md
backend/super-magic/agents/skills/using-mcp/SKILL.md
frontend/magic-web/.agents/skills/antd-style-to-tailwind/SKILL.md
frontend/magic-web/.agents/skills/code-review-expert/SKILL.md
frontend/magic-web/.agents/skills/dual-edition-module-migration/SKILL.md
frontend/magic-web/.agents/skills/magic-web-error-logging/SKILL.md
frontend/magic-web/.agents/skills/sw-best-practices/SKILL.md
frontend/magic-web/.agents/skills/ui-data-testid/SKILL.md
frontend/magic-web/.agents/skills/vercel-composition-patterns/SKILL.md
frontend/magic-web/.agents/skills/vercel-react-best-practices/SKILL.md
backend/super-magic/agents/skills/ai-card-generator/SKILL.md
backend/super-magic/agents/skills/crew-creator/SKILL.md
backend/super-magic/agents/skills/deep-research/SKILL.md
backend/super-magic/agents/skills/dingtalk-cli/SKILL.md
backend/super-magic/agents/skills/html-api-sdk/SKILL.md
backend/super-magic/agents/skills/lark-cli/SKILL.md
backend/super-magic/agents/skills/micro-app-architect/SKILL.md
backend/super-magic/agents/skills/self-media-composer/SKILL.md
backend/super-magic/agents/skills/skill-creator/SKILL.md

元信息

文件数
0
版本
f9973c5
Hash
b818f2e5
收录时间
2026-08-20 03:37

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-27 19:23
浙ICP备14020137号-1 $访客地图$