A Telegram bot to download videos, images, and music from Instagram, TikTok, YouTube, Pinterest, Snapchat, Likee, VK, Facebook, Threads, and music platforms.
Developer: @anujedits76
Downloader-Bot/
├── bot.py ← Main bot (Flask + PTB webhook)
├── requirements.txt ← Python dependencies
├── render.yaml ← Render deployment config
├── Procfile ← Process definition
├── .env.example ← Environment variable template (copy to .env)
├── .gitignore ← Files excluded from Git
├── .python-version ← Python 3.11.9
├── README.md ← This file
└── downloads/ ← Temp folder (auto-created, gitignored)
├── youtube_cookies.txt ← Optional: YouTube login cookies
├── instagram_cookies.txt ← Optional: Instagram login cookies
├── facebook_cookies.txt ← Optional: Facebook login cookies
└── tiktok_cookies.txt ← Optional: TikTok login cookies
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/YOUR_USERNAME/Downloader-Bot.git
git push -u origin main- Go to render.com → New → Web Service
- Connect your GitHub repo
- Render will auto-detect
render.yaml
Go to your service → Environment tab and add:
| Variable | Value |
|---|---|
BOT_TOKEN |
Your token from @BotFather |
BOT_USERNAME |
Your bot username (without @) |
WEBHOOK_URL |
https://your-app-name.onrender.com |
ADMIN_USER_ID |
Your Telegram numeric user ID |
REQUIRED_CHANNEL_USERNAME |
@YourChannel |
REQUIRED_CHANNEL_URL |
https://t.me/YourChannel |
PORT |
10000 ← use 10000 for Render free tier |
⚠️ Never set PORT to 8443 on Render free tier — only 10000 works.
Click Deploy. After deployment the webhook URL is set automatically.
# 1. Clone repo
git clone https://github.com/YOUR_USERNAME/Downloader-Bot.git
cd Downloader-Bot
# 2. Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Copy and fill .env
cp .env.example .env
# Edit .env with your values
# 5. Run (polling mode when no WEBHOOK_URL set)
python bot.pyCookies are managed directly from Telegram — no server access needed.
| Command | Description |
|---|---|
/cookies |
Show expiry status of all platform cookies |
/setcookies youtube |
Update YouTube cookies |
/setcookies instagram |
Update Instagram cookies |
/setcookies facebook |
Update Facebook cookies |
/setcookies tiktok |
Update TikTok cookies |
/cancel |
Cancel pending cookie update |
- Install Get cookies.txt LOCALLY Chrome extension
- Log in to YouTube / Instagram / Facebook / TikTok in your browser
- Click the extension → Export cookies for that site
- Send
/setcookies youtube(or whichever platform) to your bot - Paste the full exported cookie text
- Bot saves it automatically ✅
The bot checks cookies daily and sends you a Telegram alert if any cookie is:
- Expiring within 7 days
⚠️ - Already expired ❌
- Missing 🚫
⚠️ Never commit cookie files to Git — they are gitignored.
| Platform | Tool Used |
|---|---|
| gallery-dl (yt-dlp fallback) | |
| TikTok | gallery-dl (yt-dlp fallback) |
| YouTube | yt-dlp |
| gallery-dl | |
| Snapchat | yt-dlp |
| Likee | yt-dlp |
| VK | yt-dlp |
| yt-dlp | |
| Threads | gallery-dl (yt-dlp fallback) |
| SoundCloud | yt-dlp |
| Spotify | yt-dlp |
| Deezer | yt-dlp |
For video platforms a quality menu appears:
- 🔥 Best Quality
- 🖥 1080p (FHD)
- 📺 720p (HD)
- 📱 480p (SD)
- 📉 360p (Low)
- 🎵 Audio Only (MP3)
| Command | Description |
|---|---|
/stats |
Show total users and downloads |
/cookies |
Show cookie expiry status |
/setcookies <platform> |
Update cookies for a platform |
/cancel |
Cancel pending operation |
bot_stats.jsonis gitignored — stores user data locally- Cookie files are gitignored — never commit them
downloads/folder is auto-created and cleaned after each download- All credentials loaded from environment variables — no hardcoded secrets
- Bot works in private chats and groups/supergroups
- Enable group support in BotFather:
/setjoingroups → Enable