A Telegram bot that downloads YouTube videos in various resolutions. Built with Python and Pyrogram.
- Download YouTube videos in multiple resolutions (360p, 480p, 720p, 1080p)
- Preview video thumbnails
- Video streaming support
- Progress tracking
- Channel/Group logging support
- Python 3.8 or higher
- A Telegram Account
- API ID and Hash from my.telegram.org
- Bot Token from @BotFather
- Clone this repository:
git clone https://github.com/Shadoworbs/code.git && cd code- Install required packages:
pip install -r requirements.txt-
Create environment variables:
-
Rename
config_example.pytoconfig.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
-
-
Initialize the bot:
python login.pyFollow the prompts to authenticate your Telegram account.
- Start the bot:
python bot.py- Start the bot by sending
/startin private chat - Send a YouTube video link
- Select desired resolution from the provided buttons
- Wait for the video to download and upload
- Access the video in your chat
/start- Start the bot/help- Show help message/about- Show bot information/clean- Clean downloaded videos (Admin only)/exit- Stop the bot (Admin only)
- 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
- If buttons don't respond, send the link again
- Use
/cleanif storage space runs low - Check logs for detailed error messages
Feel free to open issues and submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.