A versatile Telegram bot for downloading media from various platforms, including YouTube, Instagram, Reddit, Pinterest, and more. Built with Python and aiogram, this bot makes it easy to download and share videos, photos, and other media directly in Telegram.
-
YouTube Support:
- Download YouTube videos (including shorts) in high quality.
-
Instagram Support:
- Download Instagram photos and videos.
- Works with both single posts and reels.
-
Reddit Support:
- Download Reddit videos.
- (Note: Reddit photos are not currently supported.)
-
X (Twitter) Support:
- Download Twitter/x.com videos.
- (Note: X (Twitter) photos are not currently supported due to API limitations.)
-
Pinterest Support:
- Download Pinterest videos.
-
Multi-Platform Compatibility:
- Works seamlessly with multiple platforms, providing a unified interface for downloading media.
-
User-Friendly:
- Simple commands and intuitive interface.
- Sends downloaded media directly to your Telegram chat.
Follow these steps to set up and run the bot on your local machine or server.
- Python 3.8 or higher
pip(Python package manager)- FFmpeg (for merging audio and video), for example on Debian-based systems:
sudo apt update && sudo apt install ffmpeg - A Telegram bot token from BotFather
-
Clone the Repository:
git clone https://github.com/not-ayan/youtube-dl-bot.git cd youtube-dl-bot -
Install Dependencies:
- For most systems:
pip install -r bot/requirements.txt
- If you encounter issues with system packages (e.g., on Linux):
pip install -r bot/requirements.txt --break-system-packages
- For most systems:
-
Configure the Bot:
- Rename the
.env.samplefile to.env:mv .env.sample .env
- Open the
.envfile and add your Telegram bot token:TOKEN=your_bot_token_here
- Rename the
-
Using Cookies for YouTube Downloads:
- If you want to use cookies for YouTube downloads, set
USE_COOKIEStotruein the.envfile:USE_COOKIES=true - Place your
cookies.txtfile in thecookiesdirectory.
- If you want to use cookies for YouTube downloads, set
-
Start the Bot:
- Run the bot using the following command:
python3 bot/main.py
- Run the bot using the following command:
Once the bot is running, simply send it a link to the media you want to download. Supported platforms include:
- YouTube: Send a YouTube video or shorts link.
- Instagram: Send an Instagram post or reel link.
- Reddit: Send a Reddit video link.
- Twitter: Send a Twitter video link.
- Pinterest: Send a Pinterest video link.
The bot will automatically detect the platform and download the media for you.
| Platform | Videos | Photos | Notes |
|---|---|---|---|
| YouTube | ✔️ | ❌ | Supports shorts and videos. |
| ✔️ | ✔️ | Works with posts and reels. | |
| ✔️ | ❌ | Photos not supported. | |
| X (Twitter) | ✔️ | ❌ | Photos not supported. |
| ✔️ | ❌ | Videos supported. |
- X (Twitter): Photos and videos are not supported due to API limitations.
- Reddit Photos: Currently not supported.
Contributions are welcome! If you'd like to add new features, fix bugs, or improve the bot, feel free to open a pull request.
- @not_ayan99 - Project maintainer.
This project is licensed under the MIT License. See the LICENSE file for details.
If you encounter any issues or have questions, feel free to open an issue on GitHub or contact @not_ayan99.
Enjoy downloading media with ease! 🎉