A simple and secure Telegram bot that receives .torrent files and saves them to a shared folder monitored by your torrent client (qBittorrent, Transmission, etc.).
Perfect for managing your torrents remotely through Telegram!
- π Secure: Only authorized chat IDs can send torrents
- π¨βπ©βπ§βπ¦ Multi-user: Support for multiple family members (comma-separated chat IDs)
- π‘ Multi-RSS: Up to 10 RSS feeds per user with custom names
- π³ Dockerized: Easy deployment with Docker Compose
- π Auto-update: Automatic Docker image builds on GitHub push
- π¦ Lightweight: Minimal Python dependencies
- π Fast: Instant torrent file transfer to your download manager
- π Logging: Complete activity logging for monitoring
- π¨ Visual UI: Beautiful interface with inline menus and buttons
- Docker and Docker Compose installed on your server
- A Telegram Bot Token (Get one from @BotFather)
- A torrent client (qBittorrent, Transmission, etc.) with a watch folder configured
- Start a conversation with @userinfobot on Telegram
- It will reply with your Chat ID (a number like
123456789) - Save this number for the next step
git clone https://github.com/artcc/send-torrent-telegram-bot.git
cd send-torrent-telegram-botCreate a .env file from the example:
cp .env.example .envEdit the .env file with your values:
# Get your bot token from @BotFather on Telegram
TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz
# Your Telegram Chat ID(s) - comma separated for multiple users
ALLOWED_CHAT_IDS=123456789,987654321
# Path to your torrent client's watch folder
TORRENT_WATCH_PATH=/path/to/qbittorrent/watch
# Path on your host system for RSS data persistence
RSS_DATA_PATH=./data
# Path to RSS storage file inside the container
RSS_STORAGE_FILE=/data/rss_urls.jsondocker-compose up -ddocker logs send-torrent-telegram-botYou should see: Bot is running...
- Open Telegram and find your bot
- Send
/startto verify your chat ID and authorization - Send any
.torrentfile to the bot - The bot will save it to your watch folder
- Your torrent client will automatically pick it up!
The bot can browse your private tracker RSS feeds and download torrents directly. You can add up to 10 RSS feeds per user!
-
Add your RSS feeds:
/setrss https://your-tracker.com/rss/key1 MyTracker /setrss https://another-tracker.com/rss/key2 AnotherOneβ οΈ Name cannot contain spaces. If you add a feed with an existing name, it will be overwritten. -
Browse your feeds:
- Use
/browsecommand, or - Click "π‘ Browse RSS Feed" button from the main menu
- If you have multiple feeds, you'll see buttons to select which one to browse
- If you have only one feed, it opens directly
- Use
-
Select torrents:
- Click on torrent titles to select (β) or deselect (β )
- Select multiple torrents at once
- See the counter showing how many are selected
-
Download selected torrents:
- Click "β¬οΈ Download (N)" button to download all selected torrents
- The bot will download them all and show a complete summary
-
Manage your feeds:
/clearrss- Shows all your feeds with delete buttons
- Confirmation required before deleting
Features:
- π‘ Up to 10 RSS feeds per user
- β Multi-selection with visual checkboxes
- πΊ Category-based emojis (Series, Movies, Others)
- π Real-time selection counter
- π Complete summary after downloading
- π Overwrite feeds by using same name
Note: Your RSS URLs are stored securely per user and include your personal RSS key from your tracker.
/start- Show welcome message and main menu/help- Show help information and all commands/status- Check bot status and authorization/menu- Show interactive menu with buttons/chatid- Show your Chat ID/author- About the author/setrss <URL> <name>- Add RSS feed with custom name (max 10)/browse- Browse and download from your RSS feeds/clearrss- Manage and delete your RSS feeds
- In qBittorrent settings, enable "Automatically add torrents from"
- Set the path to match your
TORRENT_WATCH_PATH - (Optional) Enable "Delete .torrent files afterwards"
Example docker-compose for qBittorrent:
version: '3.8'
services:
qbittorrent:
image: linuxserver/qbittorrent:latest
container_name: qbittorrent
volumes:
- ./config:/config
- ./downloads:/downloads
- ./watch:/watch # Same path as bot
ports:
- "8080:8080"
restart: unless-stopped
send-torrent-telegram-bot:
image: ghcr.io/artcc/send-torrent-telegram-bot:latest
container_name: send-torrent-telegram-bot
env_file:
- .env
volumes:
- ./watch:/watch # Shared folder for torrents
- ./data:/data # RSS data persistence
restart: unless-stopped- Go to your Portainer instance
- Navigate to Stacks β Add Stack
- Name it:
send-torrent-telegram-bot - Paste the contents of
docker-compose.yml - Add your environment variables in the "Environment variables" section
- Click Deploy the stack
Every push to the main branch automatically:
- Builds a new Docker image
- Publishes it to GitHub Container Registry
- Tags it as
latest
To update your running bot:
docker-compose pull
docker-compose up -dOr in Portainer: Click on your stack β Pull and redeploy
- Never commit your
.envfile - it contains sensitive tokens - Your bot token gives full control of your bot - keep it secret
- Only share your chat ID with trusted users
- The bot only accepts
.torrentfiles from authorized chat IDs - All unauthorized access attempts are logged
βββββββββββββββββββ
β Telegram User β
ββββββββββ¬βββββββββ
β .torrent file OR RSS browse
βΌ
βββββββββββββββββββββββ
β Telegram Bot API β
ββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Python Bot β
β (Docker Container) β
β - RSS Parser β
β - File Handler β
ββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Shared Volumes β
β - /watch (torrents)β
β - /data (RSS URLs) β
ββββββββββ¬βββββββββββββ
β
βΌ
βββββββββββββββββββββββ
β Torrent Client β
β (qBittorrent, etc) β
βββββββββββββββββββββββ
- Check if the container is running:
docker ps - Check logs:
docker logs send-torrent-telegram-bot - Verify your bot token is correct
- Ensure the bot is not rate-limited by Telegram
- Verify your chat ID is correct in
.env - Use
/startcommand to see your actual chat ID - Check for spaces in the
ALLOWED_CHAT_IDSvariable
- Verify the watch folder path is correct on both sides
- Check folder permissions:
ls -la /path/to/watch - Ensure your torrent client is monitoring the folder
- Check torrent client logs
sudo chown -R 1000:1000 /path/to/watch
sudo chmod -R 775 /path/to/watch- Empty feed: Verify your RSS URL includes your personal key
- Invalid feed: Check if the tracker is accessible from your server
- Torrents not downloading: Ensure the RSS feed provides direct .torrent links
- RSS data lost after restart: Verify
RSS_DATA_PATHvolume is mounted correctly - Cannot add more feeds: Limit is 10 feeds per user. Use
/clearrssto remove unused ones - Feed not updating: The name cannot contain spaces, use
/setrss <URL> <name>format
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Want to set a custom icon for your bot in Telegram? Download the high-resolution icon and send it to @BotFather using the /setuserpic command.
- python-telegram-bot - Excellent Telegram Bot API wrapper
- The open-source community for inspiration and tools
If you encounter any issues or have questions:
- Check the Troubleshooting section
- Search existing GitHub Issues
- Open a new issue with detailed information
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
100% built with GitHub Copilot (Claude Sonnet 4.5)
Arturo Carretero Calvo β 2026