Skip to content

Repository files navigation

YouTube Video Downloader Bot

A Telegram bot that downloads YouTube videos in various resolutions. Built with Python and Pyrogram.

Features

  • Download YouTube videos in multiple resolutions (360p, 480p, 720p, 1080p)
  • Preview video thumbnails
  • Video streaming support
  • Progress tracking
  • Channel/Group logging support

Requirements

Installation

  1. Clone this repository:
git clone https://github.com/Shadoworbs/code.git && cd code
  1. Install required packages:
pip install -r requirements.txt
  1. Create environment variables:

    • Rename config_example.py to config.py

    • Fill in the required fields:

      api_id = "YOUR_API_ID"
      api_hash = "YOUR_API_HASH"
      bot_token = "YOUR_BOT_TOKEN"
      AUTH_USERS = "your_user_id,another_user_id"  # Comma-separated list of authorized user IDs
      LINK_LOGS = "channel_id"  # Optional: Channel ID for logging downloaded links
      LOG_CHANNEL = "channel_id"  # Optional: Channel ID for forwarding downloaded videos
  2. Initialize the bot:

python login.py

Follow the prompts to authenticate your Telegram account.

  1. Start the bot:
python bot.py

Usage

  1. Start the bot by sending /start in private chat
  2. Send a YouTube video link
  3. Select desired resolution from the provided buttons
  4. Wait for the video to download and upload
  5. Access the video in your chat

Commands

  • /start - Start the bot
  • /help - Show help message
  • /about - Show bot information
  • /clean - Clean downloaded videos (Admin only)
  • /exit - Stop the bot (Admin only)

Notes

  • Large videos may take longer to process
  • Bot needs to be admin in logging channels if enabled
  • Some videos might not be available in all resolutions
  • Cache is cleared on bot restart

Error Handling

  • If buttons don't respond, send the link again
  • Use /clean if storage space runs low
  • Check logs for detailed error messages

Contributing

Feel free to open issues and submit pull requests.

License

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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages