You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TelegramDL is a Telegram Restricted Content Downloader that lets you download photos, videos, audio, documents, and stories from any Telegram source — including channels, groups, supergroups, bots, and stories. Built with ftmgram (Bot API 10.1) and Google Colab notebook for easy usage.
Note
Why TelegramDL? Telegram doesn't allow downloading from restricted channels. TelegramDL solves this by using a two-tier approach: bot token for public content, user session for restricted content.
Warning
Rate Limits: Telegram has rate limits. Built-in delays (default 10s) protect your account from bans.
# Set API_ID, API_HASH, BOT_TOKEN# Set STRING_SESSION (for restricted content)# Configure LOGIN_SYSTEM, WAITING_TIME, MAX_FILE_SIZE_MB# All settings saved as environment variables
Step 3 — Run Bot
# Apply nest_asyncio for Colab# Import and run the bot# Bot starts receiving messages
Step 4 — Generate Session String
# Enter API_ID, API_HASH, Phone Number# Receive OTP, enter code# Get session string → copy to Step 2
# Create .env file first
cp .env.example .env
nano .env # Fill in your credentials# Start
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose down
flowchart TD
A["👤 User Sends Link"] --> B["🤖 Bot Client"]
B --> C{"Can Bot Access?"}
C -->|"Yes"| D["📥 Download via Bot"]
C -->|"No (Restricted)"| E["🔐 User Session"]
E --> F["📥 Download via User"]
D --> G["📤 Send to User"]
F --> G
style A fill:#0d1117,stroke:#58a6ff,color:#e6edf3,stroke-width:2px
style C fill:#0d1117,stroke:#f97316,color:#e6edf3,stroke-width:2px
style E fill:#0d1117,stroke:#f85149,color:#e6edf3,stroke-width:2px
style G fill:#0d1117,stroke:#3fb950,color:#e6edf3,stroke-width:2px
Loading
Two-Tier Access
Tier
Client
When Used
Tier 1
Bot Token
Public channels, unrestricted content
Tier 2
User Session
Private channels, restricted content, stories
🤖 Bot Commands
User Commands
Command
Description
/start
Start the bot, show main menu
/help
Show help with topic sections
/settings
View/adjust bot settings
/login
Login with your phone number
/logout
Logout from your session
/cancel
Cancel ongoing download
/myplan
View current plan & usage
/set_thumb
Set custom thumbnail
/view_thumb
View thumbnail
/del_thumb
Delete thumbnail
/set_caption
Set custom caption
/view_caption
View caption
/del_caption
Delete caption
Premium Commands
Command
Description
/premium
View premium plans
/pay <plan>
Request premium subscription
/payment
View payment methods
Quick Commands
Command
Description
/ping
Check bot latency
/info
Show bot info & statistics
/speedtest
Test download speed
/quote
Random motivational quote
Admin Commands
Command
Description
/broadcast
Broadcast to all users
/ban <user_id>
Ban user
/unban <user_id>
Unban user
/add_premium <id> <days>
Add premium to user
/remove_premium <id>
Remove premium from user
/stats
View bot statistics
/welcome <text>
Set custom welcome message
/view_welcome
View welcome message
/del_welcome
Delete welcome message
/antispan <on/off>
Toggle anti-spam protection
Inline Keyboard Navigation
graph TB
subgraph MAIN["🏠 Main Menu"]
DL["📥 Download"]
BK["☁️ Backup"]
BT["📦 Batch"]
LG["🔐 Login"]
ST["⚙️ Settings"]
HP["❓ Help"]
end
subgraph SETTINGS["⚙️ Settings Menu"]
SD["⏱ Delay"]
SZ["📏 File Size"]
TF["🏷 Type Filter"]
CP["📝 Captions"]
FM["🔄 Forward"]
CK["💾 Checkpoint"]
BACK["🔙 Back"]
end
DL --> SETTINGS
ST --> SETTINGS
BACK --> MAIN
style MAIN fill:#1a1a2e,stroke:#e94560,color:#fff
style SETTINGS fill:#16213e,stroke:#0f3460,color:#fff
style DL fill:#27ae60,stroke:#2ecc71,color:#fff
style BK fill:#3498db,stroke:#2980b9,color:#fff
style BT fill:#9b59b6,stroke:#8e44ad,color:#fff
style LG fill:#f39c12,stroke:#f1c40f,color:#fff
style ST fill:#e74c3c,stroke:#c0392b,color:#fff
style HP fill:#1abc9c,stroke:#16a085,color:#fff
Loading
🔋 Colab Guide
Session Limits
Resource
Free
Pro
Pro+
Session
12 hrs
24 hrs
24 hrs
Idle Timeout
90 min
None
None
RAM
12 GB
25 GB
51 GB
Disk
80 GB
225 GB
225 GB
Tips
Tip
Description
Use Checkpoint
Auto-saves every 50 files, resume after disconnect