🤖 CHATGPT DRIVEN PROJECT
qbt2tg is a modular Telegram bot that lets you manage your qBittorrent downloads directly from Telegram.
Upload .torrent
files, choose categories, list and delete torrents, get notifications on completion, and enjoy smart torrent name sanitizing—all from chat!
- Add torrents: Upload
.torrent
files from Telegram, select a qBittorrent category. - Sanitized names: Human-readable torrent names, free of technical junk (configurable via
sanitize_rules.txt
). - List torrents: Numbered, clean list for quick management.
- Remove torrents: Delete torrents and downloaded files by number (with folder cleanup).
- Status checks: See all active downloads at any time.
- Completion notifications: Get a Telegram message as soon as a download finishes.
- All commands available as chat buttons.
- Easy to extend: Modular codebase, clean Python, all logic separated by role.
- All sanitizer rules editable in one file.
- Python 3.8+
- qBittorrent v4.1+ with enabled Web UI (set up in the qBittorrent app)
- Telegram bot token (get from @BotFather)
pip install python-telegram-bot requests apscheduler
- Clone this repo and enter the folder.
- Rename
config_sample.py.
toconfig.py
. - Edit
config.py
with your tokens, qBittorrent host, user, and password. - Run setup.sh
# config.py
TELEGRAM_TOKEN = 'token'
QBITTORRENT_URL = 'http://localhost:8080'
QBITTORRENT_USERNAME = 'user'
QBITTORRENT_PASSWORD = 'pass'
NOTIFY_CHAT_ID = 1
CHECK_COMPLETED_INTERVAL = 60
NOTIFIED_FILE = "notified.txt"
SANITIZE_FILE = "sanitize_rules.txt"
- Edit
sanitize_rules.txt
if you want to adjust how names are cleaned up. - Start the bot:
python3 bot.py