A Telegram bot for downloading videos and audio from YouTube with format selection options.
Disclaimer
This project is a personal educational initiative, created solely for learning purposes and is not intended for commercial use. It was developed to practice modern Python development techniques, asynchronous programming, and Telegram API interactions. Please respect copyright laws and platforms' terms of service when using this software.
Features
- Video Downloads: Get videos from YouTube in multiple formats:
- SD (480p)
- HD (720p)
- Full HD (1080p)
- Original (Maximum available quality)
- Audio Extraction: Extract high-quality MP3 (320kbps) audio from videos
- Access Control: Restrict bot usage through invitation links or admin approval
- Queue System: Asynchronous download queue for handling multiple requests
- Error Handling: Comprehensive error handling with admin notifications
- Modern Architecture: Built with asyncio, aiogram, and yt-dlp
- File Size Limit: Maximum 50MB per file (Telegram Bot API limitation)
How It Works
- Send a YouTube link to the bot
- Choose a format from the provided options
- Wait for download to complete
- Receive the file directly in your Telegram chat (up to 50MB)
Note: For videos that exceed 50MB, choose a lower quality format (SD or HD).
Quick Start
Requirements
Installation
-
Clone the repository:
git clone https://github.com/AABur/VideoGrabberBot.git cd VideoGrabberBot -
Initialize the project:
-
Configure the bot: Edit the
.envfile with your tokens:TELEGRAM_TOKEN=your_telegram_token ADMIN_USER_ID=your_telegram_user_id -
Run the bot:
Docker Deployment
If you prefer Docker:
-
Clone and configure:
git clone https://github.com/AABur/VideoGrabberBot.git cd VideoGrabberBot -
Run with Docker:
This will create a
.envfile from.env.exampletemplate. Edit it with your tokens. -
Stop when needed:
Technologies
- aiogram - Modern Telegram Bot framework
- yt-dlp - Powerful YouTube downloader
- aiosqlite - Async SQLite database
- loguru - Advanced logging
- uv - Fast Python package installer and resolver
Development
Interested in contributing? Check out CONTRIBUTING.md for development setup, coding guidelines, and contribution workflow.
License
This project is licensed under the MIT License - see the LICENSE file for details.