Skip to content

GivenBY/threadracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ThreadRacer

A dead-simple, threaded file downloader CLI written in Python.


⚙️ Features

  • Multi-threaded download of multiple files
  • Single file chunked download (download large files in parallel parts)
  • Individual + total progress bars
  • Retry logic with customizable attempts
  • Smart filename conflict handling (filename_1.ext, etc.)
  • File type detection using raw magic bytes
  • Resume support via Range headers
  • Logging system with stats (success, fail, retry)
  • CLI flags for single or batch downloads
  • Pure Python — no external downloaders

📦 Setup

git clone https://github.com/GivenBY/threadracer.git
cd threadracer
pip install -e .

🏃 Usage

Single File (Chunked Download)

threadracre -u https://example.com/large.zip -c 8 -o ./downloads

Multiple Files (Parallel Download)

threadracer -ul urls.txt -w 8 -o ./downloads

🛠️ CLI Flags

Flag(s) Description Default
-u, --url URL of the file to download (single file mode)
-ul, --urls Path to file containing multiple URLs (one per line) urls.txt
-c, --chunks Number of chunks for single file download (chunked mode) 4
-w, --workers Number of worker threads for parallel download 8
-o, --output-dir Output directory to save downloaded files ~/Downloads
-r, --retry Number of retry attempts per file 3
-f, --force Overwrite existing files without asking False
-v, --verbose Enable verbose logging to stdout False

Project Structure

root/
├── .gitignore            # Ignore files for git
├── LICENSE               # Project license
├── urls.txt              # List of URLs to download
├── pyproject.toml          # Project metadata + CLI setup
├── README.md               # You're reading it
├── urls.txt                # List of URLs to download
└── threadracer/             # Core package
    ├── __init__.py
    ├── utils.py            # Safe filename, etc.
    ├── cli/                # CLI entrypoint
    │   ├── __init__.py
    │   └── main.py         # Argparse + command dispatch
    └── core/               # Download engine
        ├── __init__.py
        ├── downloader.py   # Parallel file download logic
        ├── filetype.py     # Magic-byte-based file type detection
        ├── logger.py       # Logging + stats
        └── signatures.json # Known file signatures

TODOs

  • --resume support via partial writes + metadata
  • SHA256 hash check --checksum
  • Retry backoff logic
  • CLI log file output
  • PyPI packaging
  • Bandwidth limiting / rate control

MIT License

MIT LICENSE — use it, fork it, break it, improve it.


Contributions are welcome! Open an issue or PR if you have ideas or improvements.

About

A dead-simple, multithreaded file downloader with resume, retry, and progress ...

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages