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.
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.
- 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.
-
Clone the repository:
git clone https://github.com/teal33t/torget.git cd torget -
Install dependencies:
pip install -r requirements.txt
(
requirements.txtcontainsrequests,tqdm) -
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.
python torget.py --helpExample 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:9151This 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 tosocks5h://localhost:9150.
Basic logging is output to the console.
Add these variables to your torrc config:
CircuitBuildTimeout 120
KeepalivePeriod 60
LearnCircuitBuildTimeout 0Feel free to open issues or submit pull requests.
This project is licensed under the GNU License - see the LICENSE file for details.