This project is a Telegram bot that allows you to download videos and audio using yt-dlp or gallery-dl directly on Telegram. You can send links of videos and posts from platforms like YouTube and Instagram, and the bot will send you the files as media. The bot also supports images from Instagram, which are sent as a media group with a single caption. π²β¨
- Downloads videos and audio using the fabulous yt-dlp. π§π¬
- Handles Instagram posts using gallery-dl. πΈπ²
- Supports sending video and image files on Telegram. π¬πΉ
- Allows customization of allowed user IDs via Docker environment variables. π
- Docker π³
- Docker Compose π οΈ
- Telegram (duh π« )
version: "3.8"
services:
yatytb:
container_name: yatytb
image: ghcr.io/cchrkk/yatytb:latest
environment:
- BOT_TOKEN=${BOT_TOKEN} # REQUIRED: Bot token from BotFather
- ALLOWED_IDS=${ALLOWED_IDS} # REQUIRED: Set allowed IDs separated by comma
# Optional:- LOG_TO_FILE=false
# Optional:- LOG_FILE_PATH=bot.log
volumes:
- ./cookies.txt:/app/cookies/cookies.txt # Optional: Only set if cookies needed- BOT_TOKEN: Your Telegram bot token (required for authentication). π Ask it here @BotFather
- ALLOWED_IDS: A comma-separated list of user IDs authorized to interact with the bot. πAsk yours here @getmyid_bot
- LOG_TO_FILE: Enable this to log the console output to a file if your choice.
- LOG_FILE_PATH: Full directory to the .log file
Passing cookies to yt-dlp or gallery-dl is useful for:
- Bypassing login requirements when an extractor doesn't support explicit login functionality.
- Handling CAPTCHA challenges on certain websites (e.g., YouTube, CloudFlare).
To save cookies as a .txt file:
yt-dlp --cookies-from-browser chrome --cookies cookies.txtThis method extracts all cookies from your browserβso make sure to keep the file secure. Use firefox/vivaldi/chrome/etc. in the command.
Use these extensions to download the cookies.txt file:
- Get cookies.txt LOCALLY for Chromium-based browsers
- cookies.txt for Firefox
- Send a video or post link (YouTube, Instagram) to the bot. π¨
- The bot downloads the content and sends you the files. β¬οΈ
- If the link is an Instagram post with multiple images, the bot will send all images in a single message as a media group. πΈπ¨
- Use aiogram with local api to handle bigger files easily
- Fix Instagram photos post caption
- Fix Telegram photos post
- More variables to control max file size, max files to download per photos post, custom caption
- Cleanup code
If you want to contribute to this project, feel free to fork the repository and send a pull request with improvements or bug fixes. π οΈ
This project is licensed under the MIT License - see the LICENSE file for details.