Skip to content

cchrkk/yatytb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

95 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Yet Another yt-dlp Telegram Bot πŸŽ₯πŸ“₯

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. πŸ“²βœ¨

Features 🌟

  • 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. πŸ”’

Prerequisites βš™οΈ

  • Docker 🐳
  • Docker Compose πŸ› οΈ
  • Telegram (duh 🫠)

Ghcr.io Compose Example πŸš€

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

Environment Variables πŸ”‘

  • 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 πŸͺ

Why Pass Cookies?

Passing cookies to yt-dlp or gallery-dl is useful for:

  1. Bypassing login requirements when an extractor doesn't support explicit login functionality.
  2. Handling CAPTCHA challenges on certain websites (e.g., YouTube, CloudFlare).

Exporting Cookies from browser with yt-dlp (you will need to install it in your pc)

To save cookies as a .txt file:

yt-dlp --cookies-from-browser chrome --cookies cookies.txt

This method extracts all cookies from your browserβ€”so make sure to keep the file secure. Use firefox/vivaldi/chrome/etc. in the command.

Exporting Cookies from browser with browser extension (easy way)

Use these extensions to download the cookies.txt file:

How It Works ⚑

  1. Send a video or post link (YouTube, Instagram) to the bot. πŸ“¨
  2. The bot downloads the content and sends you the files. ⬇️
  3. If the link is an Instagram post with multiple images, the bot will send all images in a single message as a media group. πŸ“ΈπŸŽ¨

Demo Pics 🀳

Instagram Reel - handled by yt-dlp

image

Instagram Photos Post - handled by gallery-dl

image

Tiktok Video - handled by yt-dlp

image

Todo List βœ”οΈ

  • 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

Contributing πŸ’‘

If you want to contribute to this project, feel free to fork the repository and send a pull request with improvements or bug fixes. πŸ› οΈ

License πŸ“œ

This project is licensed under the MIT License - see the LICENSE file for details.

About

Yet Another Telegram yt-dlp Bot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages