arXiv Paper Downloader
A dedicated arXiv paper downloader supporting PDF/source download, keyword search, and batch operations.
Core Capabilities
- Single download: Download PDF by arXiv ID or URL, auto-rename to paper title
- Keyword search: Search arXiv by keywords, display results with metadata, guide user to download
- Source download: Download LaTeX source tarball (
.tar.gz) instead of PDF - Batch download: Download multiple papers in one command
- ID prefix: Optionally prepend arXiv ID to filename for better organization
Download Script
Script path: scripts/download_arxiv.py (stdlib only, zero external dependencies).
Usage
# Single download by arXiv ID
python3 scripts/download_arxiv.py 2501.12599
# Single download by arXiv URL
python3 scripts/download_arxiv.py https://arxiv.org/abs/2501.12599
# Download with ID prefix in filename
python3 scripts/download_arxiv.py 2501.12599 --prefix-id
# Download LaTeX source
python3 scripts/download_arxiv.py 2501.12599 --source
# Specify output directory
python3 scripts/download_arxiv.py 2501.12599 --output-dir ~/Downloads
# Keyword search
python3 scripts/download_arxiv.py --search "transformer attention"
python3 scripts/download_arxiv.py --search "diffusion model" --max-results 5
# Batch download (multiple IDs)
python3 scripts/download_arxiv.py 2501.12599 2501.12600 2501.12601
# Batch download with source and ID prefix
python3 scripts/download_arxiv.py 2501.12599 2501.12600 --source --prefix-id
Full Parameters
positional arguments:
inputs arXiv ID(s) or URL(s). Multiple for batch download.
optional arguments:
--search, -s Search arXiv by keywords (search mode ignores positional args)
--max-results, -n Max search results (default: 10)
--output-dir, -o Save directory (default: current directory)
--prefix-id, -p Add arXiv ID prefix to filename
--source, -S Download LaTeX source (.tar.gz) instead of PDF
Workflow
When the user requests arXiv paper download/search:
Scenario A: User provides URL or ID
- Extract arXiv ID from the user's message (supports
arxiv.org/abs/ID,arxiv.org/pdf/ID, or raw ID like2501.12599). - Determine output directory:
- User-specified path → use it.
- Otherwise, default to the current working directory.
- Run the script:
Adjustpython3 scripts/download_arxiv.py "<ID>" --output-dir "<DIR>" [--source] [--prefix-id]python3to the available Python runtime. - Report the saved file path to the user.
Scenario B: User searches by keyword
- Run search:
python3 scripts/download_arxiv.py --search "<query>" --max-results 10 - Present results to the user. Ask which paper(s) they want to download.
- Once the user selects, proceed with Scenario A for the chosen ID(s).
Scenario C: User wants batch download
- Collect all arXiv IDs/URLs from the user's message.
- Run:
python3 scripts/download_arxiv.py <ID1> <ID2> <ID3> ... --output-dir "<DIR>" [--source] [--prefix-id] - Report success/failure counts.
Scenario D: User wants source (LaTeX) download
- Add
--sourceflag to the download command. - The script downloads
https://arxiv.org/e-print/{id}as.tar.gz. - Note: Not all arXiv papers have source available. If a paper lacks source, arXiv returns a 403 error — inform the user accordingly.
Edge Cases & Notes
- Invalid ID: The script prints a warning — ask the user to verify the ID.
- Network timeout: Metadata requests timeout at 30s, downloads at 120s. On failure, suggest retrying.
- Source unavailable: arXiv returns HTTP 403 for papers without source uploads. Inform the user.
- Filename conflicts: The script auto-appends
(1),(2), etc. to avoid overwriting. - Special characters:
<>:"/|?*in titles are automatically stripped from filenames. - Long titles: Titles exceeding 180 characters are truncated at word boundaries.
- Rate limiting: A 0.5s delay between batch downloads to respect arXiv servers.
- arXiv API base: Uses
export.arxiv.orgfor metadata queries. If blocked, the script will error — suggest retry or VPN. - Script location: The script lives at the skill's
scripts/download_arxiv.py. Always resolve the full path relative to the skill directory before executing.




