Async Telegram bot for multi-debrid services: send it a hoster link, a magnet or a .torrent file and choose between getting the direct link or having the bot upload the file to Telegram.
- ⚡ Fully asynchronous (kurigram/pyrogram + aiohttp).
- 🧩 Multi-service: Real-Debrid, AllDebrid, TorBox, Premiumize, Debrid-Link, Mega-Debrid, Deepbrid and High-Way (use one or several, switch with
/service). - 🔗 Option 1 — Link: unlocks the link and gives you the premium direct download.
- 📤 Option 2 — File: downloads the file and uploads it to Telegram with a progress bar (2 GB limit).
- 🧲 Torrents: accepts magnets and
.torrentfiles, shows live progress and offers each file with the same two options when finished. - 🛠 Torrent manager (
/torrents): browse your torrents, check progress, get links, restart (AllDebrid, Premiumize) or delete them with inline buttons. - 📋 controlc.com pastes: extracts the links from the paste (prioritizes the hosts in
PASTE_HOST_PRIORITYincontrolc.py) and unlocks them all. - 🔐 filecrypt.cc folders: extracts links via CNL2 (Click'n'Load, same idea as JDownloader). Password: send it after the URL. Captcha folders open Chrome with uBlock Origin (+ a small popup guard) so ads don't kick you out of the container.
- 🪞 Mirror rewriting (e.g.
turb.to→turbobit.net) — editMIRRORSinmain.py. - 🔒 Optional user whitelist (
ALLOWED_USER_IDS). - 🧦 Optional proxy for debrid traffic only (
DEBRID_PROXY): SOCKS5/SOCKS4/HTTP. Useful on VPSes whose datacenter IPs are blocked by AllDebrid & co. — API calls and file downloads go through the proxy, Telegram stays direct. - 🎯 Per-hoster routing (
HOST_RULES): pin a hoster to a specific service, e.g.rapidgator:torboxunlocks every rapidgator link with TorBox regardless of the active service. - 🛟 Automatic failover (
FAILOVER, on by default): if the chosen service can't unlock a link, the bot silently tries your other configured services and answers with the first one that works. - 🔁 Optional link relay (
LINK_PROXY): instead of the raw debrid URL you get a URL served by the bot itself (http://bot_ip:8845/dl/…), and the bot streams the file from the debrid. The debrid only ever sees one IP (the server's), which avoids "downloads from multiple IPs" bans when the bot runs on a VPS. Supports resume/Range. Remember to open the port.
| Command | Description |
|---|---|
/service |
Choose the active debrid service |
/torrents |
Manage your torrents: progress, links, restart, delete |
/help |
Help |
-
Copy the config file and fill it in:
cp .env.example .env
TELEGRAM_API_IDandTELEGRAM_API_HASH: my.telegram.org/appsTELEGRAM_BOT_TOKEN: @BotFather- At least one API key from: Real-Debrid, AllDebrid, TorBox, Premiumize, Debrid-Link, Mega-Debrid (app API key or
MEGADEBRID_LOGIN/MEGADEBRID_PASSWORD), Deepbrid, High-Way (HIGHWAY_LOGIN/HIGHWAY_PASSWORD)
-
Install and run:
python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt playwright install chromium # o usa Google Chrome del sistema python main.py
Filecrypt con captcha abre el Chromium de Playwright (no el Chrome del sistema: ese ignora
--load-extension) con uBlock Origin Lite (MV3) y Filecrypt Guard. El uBlock clásico (MV2) ya no carga en Chrome moderno. En servidores sin pantalla no podrá resolver captchas.
docker build -t debrid-bot .
docker run -d --env-file .env -p 8845:8845 -v debrid_downloads:/app/downloads debrid-bot-p 8845:8845is only needed if you enableLINK_PROXY.- Add
--build-arg INSTALL_BROWSER=trueto bundle Playwright's Chromium (~700 MB extra) for filecrypt. Note that captcha-protected folders still need a display, so on a headless VPS they won't work either way — CNL2 folders (no captcha) work fine without the browser. - The
.envfile is passed at runtime and never baked into the image.
main.py # Telegram bot (handlers, progress, upload)
config.py # Configuration via environment variables / .env
controlc.py # controlc.com paste link extraction
filecrypt.py # filecrypt.cc (CNL2 + Chrome/uBlock for captcha)
extensions/
ublock/ # uBlock Origin (auto-downloaded if missing)
fc-guard/ # closes ad popups
debrid/
base.py # Common provider interface
realdebrid.py # Real-Debrid
alldebrid.py # AllDebrid (API v4/v4.1)
torbox.py # TorBox (API v1)
premiumize.py # Premiumize
debridlink.py # Debrid-Link (API v2)
megadebrid.py # Mega-Debrid
deepbrid.py # Deepbrid
highway.py # High-Way (link debrid + torrent list; adding torrents is web-only)
Original base by Oihalitz (formerly RealDebridTelegram), uploader by StarMade✨ inspired by Anasty17.