A Telegram bot to download torrents directly using magnet links, powered by the efficient Rain library.

- Direct Torrent Downloads: Fetch and download torrents effortlessly using magnet links, right within Telegram.
- Selective File Downloads: Choose specific files to download, or grab everything with a simple command.
- Real-time Progress Updates: Stay informed with live download progress notifications.
- Automatic File Upload: Receive your downloaded files directly in Telegram upon completion.
- Robust Logging System: Comprehensive logs for easy debugging and monitoring.
- Containerized for Simplicity: Deploy effortlessly with Docker.
.
├── bot/ # Bot logic
├── config/ # Configuration handling
├── server/ # Core functionality
├── downloads/ # Downloaded files storage
├── logs/ # Log files
├── .env # Environment variables
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker build instructions
├── go.mod # Go module definition
├── go.sum # Go module checksums
├── main.go # Application entry point
└── Makefile # Build and run automation
- Go 1.22+: Ensure you have the latest Go version installed.
- Docker & Docker Compose: For containerized deployment.
- Telegram Bot Token: Obtain yours from @BotFather.
- Clone the Repository:
git clone [https://github.com/NisoD/torrent-bot-telegram.git](https://www.google.com/search?q=https://github.com/NisoD/torrent-bot-telegram.git) cd torrent-bot-telegram
- Setup Environment:
make setup
- Configure
.env:TELEGRAM_BOT_TOKEN=your_bot_token_here - Run the Bot:
make run
- Setup Environment:
make setup
- Configure
.env: Add your Telegram bot token. - Build and Run with Docker:
make docker-run
- View Logs:
make docker-logs
- Stop the Container:
make docker-stop
| Variable | Description | Default |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Your Telegram bot token (Required) | (Required) |
DOWNLOAD_PATH |
Path to store downloaded files | /app/downloads |
LOG_PATH |
Path to store log files | /app/logs |
MAX_FILE_SIZE |
Maximum file size for upload (in bytes) | 50MB (52428800) |
Note: For group usage, the MAX_FILE_SIZE can be increased to 2GB.
- Start a Chat: Initiate a conversation with your bot on Telegram.
- Begin: Send
/startto get started. - Send a Magnet Link: Paste a magnet link to fetch torrent information.
- Select Files:
- Specify file numbers separated by commas (e.g.,
1,3,5). - Send
allto download all files.
- Specify file numbers separated by commas (e.g.,
- Download and Receive: The bot will download and upload the selected files directly to your chat.
- Bot Not Responding: Verify your
TELEGRAM_BOT_TOKENand ensure the bot is running. - Download Failures: Some torrents may have limited or no seeders.
- Upload Limits: Telegram bots have a 50MB file size limit (extendable to 2GB in groups).
The next phase of this project will include:
- AWS S3 Integration: Seamlessly store and manage your downloaded files in the cloud.
- Serverless Architecture: Exploring serverless technologies to optimize resource usage and scalability.
Stay tuned for these exciting updates!
This tool is intended for downloading and sharing legal content only. Users are responsible for complying with all applicable copyright laws.
