file-downloader
npx machina-cli add skill nemori-ai/agent_skills/file-downloader --openclawFile Downloader
Download files from specified URLs to local, supporting HTTP/HTTPS protocols.
⚠️ Important Note
Always use absolute paths for output! Skills directory should remain clean, only storing skill code.
Usage
Basic Download
# Download file (recommended)
skills_run(name="file-downloader", command="python scripts/download.py https://example.com/file.pdf -o /Users/xxx/Downloads/file.pdf")
# Download with progress display
skills_run(name="file-downloader", command="python scripts/download.py https://example.com/file.pdf -o /Users/xxx/Downloads/file.pdf -v")
Advanced Options
# Set timeout (seconds)
skills_run(name="file-downloader", command="python scripts/download.py https://example.com/file.pdf -o /Users/xxx/Downloads/file.pdf --timeout 60")
# Set user agent
skills_run(name="file-downloader", command="python scripts/download.py https://example.com/file.pdf -o /Users/xxx/Downloads/file.pdf --user-agent 'Mozilla/5.0'")
# Overwrite existing file
skills_run(name="file-downloader", command="python scripts/download.py https://example.com/file.pdf -o /Users/xxx/Downloads/file.pdf -f")
Features
- ✅ HTTP/HTTPS protocol support
- ✅ Automatic filename detection
- ✅ Download progress display
- ✅ Resume download (TODO)
- ✅ Custom request headers
- ✅ File integrity verification
Parameters
url: URL of file to download (required)-o, --output: Output file path (use absolute path)-v, --verbose: Show detailed progress info-f, --force: Overwrite existing file--timeout: Request timeout in seconds (default 30s)--user-agent: Custom User-Agent
Path Guidelines
| Path | Description |
|---|---|
| Absolute paths | User workspace, all downloaded files should be saved here |
/skills/ | Skill code directory, do not save user files here |
Source
git clone https://github.com/nemori-ai/agent_skills/blob/main/agent_skills/skills/file-downloader/SKILL.mdView on GitHub Overview
The file-downloader skill fetches files from HTTP/HTTPS URLs and saves them to a local path. It supports automatic filename detection, progress display, and configurable headers and timeouts. Absolute output paths are required to keep user files organized and the skill directory clean.
How This Skill Works
The skill invokes the download script with the target URL and an absolute output path. It handles HTTP/HTTPS requests, applies optional timeout and headers (like a custom user-agent), and writes the file to disk, showing progress when -v is used. It also performs a basic integrity check post-download as part of its feature set.
When to Use It
- You need to save a downloaded file to a specific absolute path on your machine.
- You want to monitor download progress in real-time using -v.
- The target server requires a custom User-Agent or additional headers.
- You want to ensure existing files are overwritten only when you specify -f.
- You want to cap the download duration to avoid hangs using --timeout.
Quick Start
- Step 1: Run a basic download: skills_run(name="file-downloader", command="python scripts/download.py https://example.com/file.pdf -o /absolute/path/file.pdf")
- Step 2: Enable progress during the download: skills_run(..., command="python scripts/download.py https://example.com/file.pdf -o /absolute/path/file.pdf -v")
- Step 3: Enhance reliability with timeout or headers: skills_run(..., command="python scripts/download.py https://example.com/file.pdf -o /absolute/path/file.pdf --timeout 60 --user-agent 'YourAgent'")
Best Practices
- Always provide an absolute path for -o to comply with the skill's path guidelines.
- Use -v to see a live progress bar for large downloads.
- Set a sensible --timeout to prevent stalled downloads (default is 30s).
- When servers require it, supply a realistic --user-agent string.
- If provided, verify file integrity after download and compare against known checksums.
Example Use Cases
- python scripts/download.py https://example.com/file.pdf -o /Users/you/Downloads/file.pdf
- python scripts/download.py https://example.com/file.pdf -o /Users/you/Downloads/file.pdf -v
- python scripts/download.py https://example.com/file.pdf -o /Users/you/Downloads/file.pdf --timeout 60
- python scripts/download.py https://example.com/file.pdf -o /Users/you/Downloads/file.pdf --user-agent 'Mozilla/5.0'
- python scripts/download.py https://example.com/file.pdf -o /Users/you/Downloads/file.pdf -f