TT-Bot is a production-grade Telegram bot for downloading TikTok and Instagram content without watermarks. It features proxy rotation, queue management, and multilingual support.
Prerequisites
Before you begin, ensure you have:- Docker and Docker Compose installed
- A Telegram Bot Token from @BotFather
- Telegram API credentials (API ID and API Hash) from my.telegram.org
- A RapidAPI key for Instagram downloads (optional)
Quick Start with Docker Compose
Configure environment variables
Create a Edit
.env file from the example:.env and configure the required variables:Verify the bot is running
Check the logs to ensure everything started correctly:You should see output like:
Using the Bot
Basic Commands
/start
Initialize the bot and see welcome message
/lang
Change bot language (supports English, Russian, Arabic, Hindi, and more)
/mode
Toggle between video and file mode for downloads
Downloading Content
Supported Content Types
| Platform | Videos | Images/Slideshows | Audio |
|---|---|---|---|
| TikTok | ✅ | ✅ | ✅ |
| ✅ | ✅ | ❌ |
Alternative Deployment Options
Docker (Single Container)
Run only the bot without the full stack:Local Development with uv
For development without Docker:Troubleshooting
Bot doesn't respond to messages
Bot doesn't respond to messages
Check bot token validity:Verify the bot is running:Common issues:
- Incorrect
BOT_TOKENin.env - Bot not started in Telegram (send
/startfirst) - Firewall blocking outbound connections
TikTok downloads fail with network errors
TikTok downloads fail with network errors
TikTok uses aggressive anti-bot measures. Solutions:1. Use proxies:Create Update 2. Add cookies:Export TikTok cookies using a browser extension and save to 3. Adjust retry settings:
proxies.txt with one proxy per line:.env:cookies.txt, then:Database connection errors
Database connection errors
With Docker Compose:Ensure the database service is running:The With external database:Update connection string with your database credentials:
DB_URL should match Docker Compose service names:Instagram downloads not working
Instagram downloads not working
Instagram downloads require a RapidAPI key:
- Sign up at RapidAPI
- Subscribe to an Instagram API (search for “Instagram” in the API marketplace)
- Copy your API key and add to
.env:
Queue full errors
Queue full errors
Users see “Please wait! You already have X videos processing” when:Or remove the limit entirely:
MAX_USER_QUEUE_SIZElimit is reached (default: 0 = unlimited)- Multiple large downloads are processing simultaneously
Out of memory errors
Out of memory errors
For large videos or high traffic:1. Enable streaming mode:2. Set maximum duration:3. Increase Docker memory limits:Edit
docker-compose.yml:Local Telegram Bot API server issues
Local Telegram Bot API server issues
The local API server (
telegram-bot-api service) provides:- Faster uploads/downloads
- No rate limits
- Support for larger files (up to 2GB)
- Check it’s running:
-
Verify
TELEGRAM_API_IDandTELEGRAM_API_HASHare correct - Fall back to public API:
When using public API, you don’t need
TELEGRAM_API_ID or TELEGRAM_API_HASH, but you’ll have stricter rate limits.Next Steps
Configuration
Learn about all configuration options and environment variables
Architecture
Understand the bot’s internal architecture and design patterns
Development
Set up your development environment and contribute
Deployment
Production deployment guides and best practices

