Skip to content

teal33t/torget.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

torget.py - Tor Downloader

torget.py is a multi-threaded Python script designed to download content from Tor (onion) sites. It focuses on efficient downloading through Tor proxies.

The Tor (The Onion Router) network provides unparalleled anonymity and privacy for internet users by routing traffic through a series of volunteer-operated relays. While this multi-layered encryption and relay system is crucial for protecting user identity and location, it inherently introduces significant latency, making Tor notoriously slow for tasks like downloading large files. This project explores the fundamental reasons behind Tor's performance bottlenecks and introduces torget.py, a specialized downloader designed to mitigate some of these challenges.

Learn More About Tor Optimization

For a detailed explanation of why the Tor network is slow and how torget.py addresses these challenges, please read our comprehensive Medium post:

torget.py: I Built a Tool to Fix My Biggest Frustration with Tor Network

The article explores the fundamental reasons behind Tor's performance bottlenecks and explains the technical strategies employed by torget.py to optimize downloads within the constraints of the Tor network.

Features

  • Multi-threaded: Efficiently downloads content using multiple worker threads.
  • Tor Proxy Support: Configurable to use a list of Tor SOCKS5 proxies.
  • Configurable: All settings are managed via command-line arguments.

Installation

  1. Clone the repository:

    git clone https://github.com/teal33t/torget.git
    cd torget
  2. Install dependencies:

    pip install -r requirements.txt

    (requirements.txt contains requests, tqdm)

  3. Tor Setup: Ensure you have Tor running and configured to provide SOCKS5 proxies. The script expects proxies to be available at socks5h://localhost:PORT. You are responsible for managing your Tor proxy setup.

Usage

Command Line Arguments

python torget.py --help

Example usage:

python torget.py --url=http://example.onion/path/to/file.zip --out-dir=./downloads --max-workers=5 --proxy-list socks5h://localhost:9150 socks5h://localhost:9151

This command will download file.zip directly into the ./downloads directory.

  • --url: (Required) The URL to download (e.g., http://example.onion/file.zip).
  • --out-dir: Directory to save downloaded files (defaults to ./downloads). Files will be saved directly into this directory, without creating subdirectories based on the URL structure.
  • --max-workers: Maximum number of worker threads (defaults to 1).
  • --proxy-list: Space-separated list of Tor proxy addresses (e.g., socks5h://localhost:9050 socks5h://localhost:9051). Defaults to socks5h://localhost:9150.

Logging

Basic logging is output to the console.

How setup a fast as it can tor node?

Add these variables to your torrc config:

CircuitBuildTimeout 120
KeepalivePeriod 60
LearnCircuitBuildTimeout 0

Contributing

Feel free to open issues or submit pull requests.

License

This project is licensed under the GNU License - see the LICENSE file for details.

About

A fast large file downloader using multiple Tor circuits.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages