A powerful Telegram bot that acts as an ultimate download and bypass tool. It downloads direct links, videos, local Telegram files, processes them, and pushes them directly to your GitHub repository to generate filter-free raw direct links.
- ⚡ Blazing Fast Downloads: Uses
Aria2c(up to 4 concurrent connections) for direct links. - 🎬 Media Extraction: Integrated with
yt-dlpto download videos from YouTube, Twitch, Vimeo, Reddit, SoundCloud, and more. - 🔓 Bunkr Bypass: Built-in custom API decryptor to download directly from Bunkr domains without restrictions.
- 📁 Telegram File Support: Forward or upload any local file (Document, Video, Audio, Photo) directly to the bot. Supports large files up to 2GB via Pyrogram!
- 🗜️ Smart Archiving & Splitting: Automatically uses
7-Zipto compress files. Files larger than90MBare split into.zip.001,.zip.002parts to bypass GitHub's file size limit. Password protection is supported. - 📝 Auto
Links.mdGenerator: Automatically updates aLinks.mdfile in your repository with categorized download links and timestamps. - 📊 Live Progress Bar: Clean and non-spammy progress updates inside Telegram.
- 🔁 Smart Cookie Fallback: Automatically retries downloads without cookies if cookie-based download fails.
Ensure you have Python 3.9+ and the required CLI tools installed:
sudo apt-get update
sudo apt-get install -y aria2 ffmpeg p7zip-full git unzipInstall yt-dlp (latest binary — recommended over apt version):
sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
sudo chmod a+rx /usr/local/bin/yt-dlp
⚠️ Important: Do NOT useapt install yt-dlp— the apt version is outdated and will fail on modern YouTube.
git clone https://github.com/YOUR_USERNAME/sandbox.git
cd sandboxwget https://github.com/YOUR_USERNAME/sandbox/archive/refs/heads/main.zip -O sandbox.zip
unzip sandbox.zip
cd sandbox-main1. Create the Virtual Environment:
python3 -m venv venv
source venv/bin/activate2. Install Python Dependencies:
pip install -r requirements.txt3. Configure Environment Variables:
Create a .env file in the root directory:
# Get this from @BotFather on Telegram
BOT_TOKEN=123456789:YOUR_BOT_TOKEN_HERE
# Database URI (SQLite is default, no setup needed)
DB_URL=sqlite:///database/bot.db
# Telegram API Credentials (REQUIRED for downloading files > 20MB)
# Get these from https://my.telegram.org
TG_API_ID=1234567
TG_API_HASH=your_api_hash_here
# YouTube Cookies — Optional (see cookie setup section below)
# Option A: Path to a cookies.txt file on your server
YOUTUBE_COOKIES=youtube_cookies.txt
# Option B: Paste the entire cookie content in double quotes
# YOUTUBE_COOKIES="# Netscape HTTP Cookie File
# .youtube.com TRUE / TRUE ..."python bot.pyOr with PM2 for production:
pm2 start bot.py --name "rgit-bot" --interpreter python3
pm2 save| Command | Description |
|---|---|
/start |
Initialize the bot |
/set_token <PAT> |
Link your GitHub Personal Access Token (requires Contents: Write permission) |
/set_repo <username/repo> |
Set your target GitHub repository |
/status |
Check your current configuration |
💡 Just send any URL or Telegram File to the bot, choose your quality/compression via inline buttons, and get your raw direct links!
Telegram's standard Bot API restricts file downloads to 20MB. To bypass this and download files up to 2GB, you must provide your Telegram API credentials.
- Log in to my.telegram.org.
- Go to API development tools.
- Create a new application (if you haven't already).
- Copy your App api_id and App api_hash.
- Add them to your
.envfile underTG_API_IDandTG_API_HASH.
YouTube may block downloads from server IPs. Providing cookies from a logged-in browser session can help bypass this.
⚠️ Use a secondary/burner Google account — never your main account.
Step 1 — Install the browser extension: -Chrome — Get cookies.txt LOCALLY -Firefox — Get cookies.txt LOCALLY
Step 2 — Export cookies:
Log in to YouTube, click the extension, and export as cookies.txt.
Step 3 — Add to your server:
Upload cookies.txt to your bot's directory, then in .env:
YOUTUBE_COOKIES=youtube_cookies.txtStep 4 — Restart the bot.
💡 Note: The bot automatically retries without cookies if cookie-based download fails, so it works even if your cookies expire.
Since GitHub limits file sizes to 100MB, the bot splits large files into multiple parts (.zip.001, .zip.002, etc.). Here is how to easily extract them:
- Install
p7zip:pkg update pkg install p7zip
- Navigate to your download folder and extract the first part (it will automatically find and merge the rest of the parts):
7z x your_file_name.zip.001
- Download all parts (
.001,.002, etc.) and put them in the same folder. - Install 7-Zip or WinRAR.
- Right-click on the
.zip.001file and select Extract Here.
.
├── bot.py # Entry point
├── config.py # Environment config
├── requirements.txt
├── .env # Your secrets (never commit this!)
├── core/
│ ├── archiver.py # 7zip compression & splitting
│ ├── bunkr_engine.py # Bunkr API bypass downloader
│ ├── downloader.py # Aria2c direct downloader
│ ├── progress.py # Telegram progress bar
│ ├── tg_downloader.py # Pyrogram engine for large files
│ └── ytdlp_engine.py # yt-dlp media downloader
├── database/
│ ├── models.py # SQLAlchemy models
│ └── crud.py # DB operations
├── github_integration/
│ └── git_manager.py # Git clone/push logic
└── handlers/
├── commands.py # Bot commands
├── messages.py # URL & file handlers
└── callbacks.py # Inline keyboard callbacks
- Go to GitHub → Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
- Click Generate new token (classic)
- Give it a name, set expiration, and check
repo→Contents: Write - Copy the token and send
/set_token <your_token>to the bot
- GitHub has a 100MB hard limit per file. The bot automatically splits files at 90MB to stay safe.
- The
Links.mdfile in your repo is updated automatically with every upload and includes Tehran (IR) timestamps. tmp_downloads/is used as a working directory and is cleaned up after each upload.- Do not commit your
.envfile oryoutube_cookies.txt— add them to.gitignore.
.env
youtube_cookies.txt
tmp_downloads/
database/bot.dbMade with ❤️ — Pull requests welcome!