360 Secure SkillHub
360 安全技能中心

File Downloader

提供一个命令行脚本,接收 URL 与可选保存路径,经 HTTP/HTTPS 下载任意类型文件(图片、音频、视频、文档等)到本地,并以 JSON 输出成功或失败结果;依赖 Python 3 与 requests 包,需要网络访问。

jpengcheng523-netizen
jpengcheng523-netizen
热度 59.23
最近更新 2026-05-11 17:35:43
分类:自动化依赖:代码执行 / 读写文件 / 第三方 API应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add downloader
Metadata
name
downloader
description
Download a file from a URL and save it locally.

downloader

Download a file from a given URL and save it to a specified local path. Supports any file type accessible via HTTP/HTTPS.

When to Use

✅ USE this skill when:

  • When the user wants to download a file from a URL to the local machine.
  • When the user needs to save a remote resource (image, audio, video, document, etc.) locally.
  • When the user provides a download link and wants to store the file at a specific path.

When NOT to Use

❌ DON'T use this skill when:

  • When the user only wants to view or read a URL content without saving to disk.

Parameters

Parameter Type Required Description
url string Yes The URL of the file to download
save_path string No Local path to save the file (defaults to current directory with original filename)

Commands

Basic Call

python3 scripts/download.py --url 'https://example.com/file.png'

Save to a specific path

python3 scripts/download.py --url 'https://example.com/file.png' --save_path './downloads/image.png'

Examples

"Help me download this image."

python3 scripts/download.py --url 'https://example.com/photo.jpg'

"Download this PDF and save it to the reports folder."

python3 scripts/download.py --url 'https://example.com/report.pdf' --save_path './reports/report.pdf'

Response

Script outputs JSON to stdout:

  • code = 0 — success, data contains the local file path where the file was saved
  • code != 0 — error, show message to the user and suggest retrying
{
  "code": 0,
  "message": "success",
  "data": "./downloads/file.png"
}

Notes

  • Requires requests package: pip install requests