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.
68
83%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
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.
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.
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)Referer and only its scheme plus host for Origin.Cookie or Authorization only when the user explicitly provided the value for this download.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.
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:
.part or .part.meta paths;Range or If-Range;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
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.