Skip to content

🌟 YouTubeDLBot is a powerful Telegram bot designed for downloading YouTube videos and audio with a smooth user experience. πŸ’₯ Built with stability and speed By Abir Arafat Chawdhury [@abirxdhack]

Notifications You must be signed in to change notification settings

TheSmartDevs/YouTubeDLBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 YouTubeDLBot ⭐️

GitHub Stars GitHub Forks GitHub Issues License

🌟 YouTubeDLBot is a powerful Telegram bot designed for downloading YouTube videos and audio with a smooth user experience. πŸ’₯ Built with stability and speed in mind, it leverages modern technologies like Pyrogram, aiohttp, and workers for efficient performance. ❄️ The bot supports video quality selection, high-quality audio downloads, and error handling for seamless YouTube content access. ✨

🌟 Features πŸ“ˆ

  • ⭐️ Video Quality Selection: Choose from 1080p, 720p, 480p, 360p, or 144p using interactive buttons. πŸ‘€
  • πŸ’₯ Audio Quality Options: Download audio with 256kbps or 128kbps bitrate for high-quality sound. ❄️
  • 🌟 Progress Bar: Real-time progress bar for a smooth downloading experience. ✨
  • πŸ“ˆ Message Editing: Updates messages dynamically for a polished user interface. πŸ’€
  • ⭐️ Pyrogram Stability: Built with Pyrogram for reliable Telegram bot functionality. πŸ‘€
  • πŸ’₯ Asynchronous Requests: Uses aiohttp for fast, non-blocking HTTP requests. ❄️
  • 🌟 Worker Clients: Enhances download speed with multiple client workers. ✨
  • πŸ“ˆ Error Handling with Cookies: Manages YouTube download errors using a cookies file to bypass sign-in requirements. πŸ’€

🌟 Bot Commands ⭐️

  • /start - Start the bot 🌟
  • /yt - Download a YouTube video πŸ’₯
  • /video - Download a YouTube video ❄️
  • /song - Download a YouTube song πŸ“ˆ
  • /stats - View total bot users and groups πŸ‘€
  • /send - Broadcast messages with premium emojis ✨
  • /broadcast - Broadcast messages with normal emojis πŸ’€
  • /logs - Retrieve bot logs for error troubleshooting ⭐️
  • /restart - Restart the bot 🌟
  • /speedtest - Test your VPS speed πŸ’₯

🌟 Handling YouTube Download Errors with Cookies ❄️

πŸ’₯ To avoid errors related to YouTube sign-in requirements, the bot uses a cookie file for seamless content access. Follow these steps to set it up: ✨

⭐️ Steps to Export and Use Cookies πŸ‘€

  1. 🌟 Create a Dedicated Chrome Profile:
    • Create a new Chrome profile for managing your bot's cookies to keep things organized. ❄️
  2. πŸ’₯ Install a Cookie Management Extension:
    • Use "Cookie Editor" or a similar extension to manage cookies. πŸ“ˆ
  3. ⭐️ Export Cookies from YouTube:
    • Log into YouTube in your new browser profile. πŸ’€
    • Use the cookie extension to export cookies in Netscape format. ✨
  4. 🌟 Save the Cookies File:
    • Save the exported cookies as ItsSmartToolBot.txt in the YouTubeDLBot/cookies directory of your project. πŸ‘€

πŸ“ˆ Managing Cookies ❄️

  • πŸ’₯ Cookie Expiry:
    • If you encounter download issues, refresh your cookies by exporting a new ItsSmartToolBot.txt file. ⭐️
  • 🌟 Cookie Depletion:
    • Avoid frequent bot restarts and excessive YouTube requests to prevent early cookie expiry. ✨

πŸ‘€ This setup ensures efficient access to YouTube content without sign-in or bot protection errors. πŸ’€

🌟 Deployment πŸ’₯

You can deploy YouTubeDLBot using one of the following methods: ❄️

⭐️ Option 1: Docker πŸ“ˆ

git clone https://github.com/TheSmartDevs/YouTubeDLBot
cd YouTubeDLBot
docker compose up --build --remove-orphans

πŸ’₯ Option 2: Python πŸ‘€

git clone https://github.com/TheSmartDevs/YouTubeDLBot
cd YouTubeDLBot
pip3 install -r requirements.txt
python3 main.py

🌟 Option 3: Using Screen ✨

git clone https://github.com/TheSmartDevs/YouTubeDLBot
cd YouTubeDLBot
pip3 install -r requirements.txt
screen python3 main.py

🌟 Environment Variables ❄️

πŸ’₯ The bot requires certain environment variables to function correctly. You can configure these in one of two ways: ⭐️

  1. πŸ“ˆ Using a .env File: Create a .env file in the project root directory and set the variables there. πŸ‘€
  2. 🌟 Editing config.py: Directly modify the default values in the config.py file located in the project directory. ✨

πŸ’₯ Mandatory Environment Variables πŸ’€

  • API_ID: Your Telegram API ID (e.g., Your API_ID Here). ❄️
  • API_HASH: Your Telegram API Hash (e.g., Your API_HASH Here). ⭐️
  • BOT_TOKEN: The Telegram bot token obtained from BotFather (e.g., Your BOT_TOKEN Here). πŸ“ˆ
  • OWNER_IDS: Comma-separated Telegram user IDs of bot owners (e.g., Your OWNER_IDS Here). πŸ‘€
  • MONGO_URL: MongoDB connection URL for storing bot data (e.g., Your MONGO_URL Here). ✨
  • YT_COOKIES_PATH: Path to the YouTube cookies file (e.g., ./cookies/ItsSmartToolBot.txt). πŸ’₯

🌟 Recommended Environment Variables ❄️

  • COMMAND_PREFIX: Prefixes for bot commands (e.g., Your COMMAND_PREFIX Here). ⭐️
  • MAX_VIDEO_SIZE: Maximum video size in bytes (e.g., Your MAX_VIDEO_SIZE Here). πŸ“ˆ
  • UPDATE_CHANNEL_URL: Telegram channel for bot updates (e.g., Your UPDATE_CHANNEL_URL Here). πŸ‘€
  • DEVELOPER_USER_ID: Telegram user ID of the primary developer (e.g., Your DEVELOPER_USER_ID Here). ✨
  • START_MSG_PHOTO: URL of the photo displayed in the start message (e.g., Your START_MSG_PHOTO Here). πŸ’₯

πŸ’€ Example .env File 🌟

# Bot Configuration
API_ID=Your API_ID Here
API_HASH=Your API_HASH Here
BOT_TOKEN=Your BOT_TOKEN Here
OWNER_IDS=Your OWNER_IDS Here
MONGO_URL=Your MONGO_URL Here

# Constants
COMMAND_PREFIX=Your COMMAND_PREFIX Here
YT_COOKIES_PATH=./cookies/ItsSmartToolBot.txt
MAX_VIDEO_SIZE=Your MAX_VIDEO_SIZE Here
UPDATE_CHANNEL_URL=Your UPDATE_CHANNEL_URL Here
DEVELOPER_USER_ID=Your DEVELOPER_USER_ID Here
START_MSG_PHOTO=Your START_MSG_PHOTO Here

⭐️ Configuring via config.py πŸ“ˆ

🌟 Alternatively, you can edit the config.py file directly to set the default values for the variables. ❄️ The file uses environment variables if available, but falls back to the defaults specified in config.py if the .env file is not present or specific variables are unset. πŸ’₯ Open config.py and modify the default values in the get_env_or_default function calls to match your configuration. πŸ‘€

Example config.py Snippet:

API_ID = get_env_or_default("API_ID", Your API_ID Here, int)
API_HASH = get_env_or_default("API_HASH", "Your API_HASH Here")
BOT_TOKEN = get_env_or_default("BOT_TOKEN", "Your BOT_TOKEN Here")

🌟 Requirements πŸ’₯

  • Python 3.8+ ❄️
  • Docker (for Docker deployment) ⭐️
  • Dependencies listed in requirements.txt πŸ“ˆ
  • A valid ItsSmartToolBot.txt file in YouTubeDLBot/cookies for YouTube access πŸ‘€

🌟 Project Author ⭐️

Abir Arafat Chawdhruy ✨

🌟 Contributing ❄️

πŸ’₯ Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes. πŸ“ˆ To report an issue, contact @ISmartDevs on Telegram. πŸ‘€

About

🌟 YouTubeDLBot is a powerful Telegram bot designed for downloading YouTube videos and audio with a smooth user experience. πŸ’₯ Built with stability and speed By Abir Arafat Chawdhury [@abirxdhack]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages