Telegram Media Downloader is a Python-based bot designed to download videos and audios from platforms like YouTube, Twitter/X, and TikTok. If the file exceeds Telegram's 50 MB limit, it automatically compresses the file using ffmpeg
and sends it to the user. This bot allows easy downloading and conversion of media through simple commands.
- 📥 Download videos from:
- YouTube
- Twitter/X
- TikTok
- 🎵 Audio extraction in MP3 format
- 📊 Real-time progress bar
- 🔄 Automatic format conversion
- 💾 Smart temporary storage management
- ⚡ Asynchronous processing for better performance
- Clone the repository
git clone https://github.com/yourusername/teledown-bot.git
cd teledown-bot
- Create a virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
- Install dependencies
pip install -r requirements.txt
- Configure the bot
- Get a token from @BotFather on Telegram
- Create a
.env
file based on.env.example
API_TOKEN=your_token_here
TEMP_DOWNLOAD_FOLDER=/path/to/temp/folder
- Start the bot
python bot.py
Command | Description | Example |
---|---|---|
/start |
Start the bot and show instructions | /start |
/video |
Download a video | /video https://youtube.com/... |
/audio |
Extract audio from a video | /audio https://youtube.com/... |
/help |
Show help and available commands | /help |
1. Download YouTube video:
/video https://youtube.com/watch?v=...
2. Extract audio from Twitter video:
/audio https://twitter.com/user/status/...
3. Download TikTok video:
/video https://tiktok.com/@user/video/...
Variable | Description | Default Value |
---|---|---|
API_TOKEN |
Telegram Bot Token | - |
TEMP_DOWNLOAD_FOLDER |
Temporary folder | ./downloads |
TELEGRAM_MAX_SIZE_MB |
Size limit | 50 |
- Python 3.8+
- python-telegram-bot: Telegram bot framework
- yt-dlp: Multimedia content download library
- asyncio: For asynchronous operations
teledown-bot/
├── bot.py # Main bot code
├── requirements.txt # Project dependencies
├── .env # Environment variables
├── .gitignore # Files ignored by git
└── README.md # Documentation
Contributions are welcome. Please:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add: new feature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Maximum file size: 50MB (Telegram limit)
- Some videos may not be available for download
- Downloads depend on connection speed
- Open an issue to report bugs