A comprehensive YouTube video and audio downloader with both command-line and GUI interfaces. Built with Python and tkinter, featuring download progress tracking, error handling, and comprehensive logging for seamless media extraction from YouTube.
- Multiple Download Modes: Single videos, multiple videos, and entire playlists/channels
- Format Options: Download as MP4 (video) or MP3 (audio) with customizable quality
- GUI Interface: User-friendly tkinter-based graphical interface with loading animations
- Command Line Tools: Lightweight CLI versions for automation and scripting
- Song Search: Search and download songs by name using YouTube search integration
- Batch Processing: Download multiple videos simultaneously with queue management
- Progress Tracking: Real-time download progress with animated loading indicators
- Error Handling: Robust error handling with user-friendly error messages
- Rate Limit Management: Built-in YouTube rate limiting detection and handling
- Comprehensive Logging: Detailed logging system for debugging and monitoring
- Cross-Platform: Works on Windows, Linux, and macOS
- Thread Safety: Non-blocking downloads with background processing
| Component | Technology |
|---|---|
| GUI Framework | tkinter (Python built-in) |
| YouTube Integration | yt-dlp 2023.x, youtube-search-python |
| Media Processing | FFmpeg |
| Logging | Python logging module |
| Threading | Python threading for non-blocking operations |
| Cross-Platform | Python 3.8+ compatible |
youtubePython/
βββ link_gui.py # GUI version with tkinter interface
βββ link.py # Command-line video/playlist downloader
βββ song.py # Song search and download tool
βββ view_logs.py # Log viewer utility
βββ install.sh # Linux/macOS installation script
βββ install.ps1 # Windows PowerShell installation script
βββ logs/ # Application logs directory
β βββ youtube_downloader_YYYYMMDD.log
βββ .venv/ # Python virtual environment
βββ .gitignore # Git ignore rules
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ LOGGING.md # Detailed logging guide
βββ TODO.md # Development roadmap
βββ LICENSE # MIT License
- URL Processing: Accepts YouTube video, playlist, or channel URLs
- Format Selection: User chooses between MP4 (video) or MP3 (audio) output
- Quality Optimization: Automatically selects best available quality for chosen format
- Download Processing: Uses yt-dlp for robust video extraction and FFmpeg for conversion
- Progress Feedback: Real-time progress updates with loading animations
- Error Recovery: Automatic retry mechanisms and user-friendly error reporting
- File Organization: Organized output with playlist folders and proper naming
- Python 3.8 or higher
- FFmpeg (for audio conversion)
- Git
-
Clone the repository:
git clone https://github.com/ArindamTripathi619/youtubePython.git cd youtubePython -
Run automated installation:
chmod +x install.sh ./install.sh
Or manual setup:
-
Set up virtual environment:
python3 -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install yt-dlp youtube-search-python
-
Install FFmpeg:
# Ubuntu/Debian sudo apt install ffmpeg # macOS (with Homebrew) brew install ffmpeg # Arch Linux sudo pacman -S ffmpeg
-
Run the application:
# GUI Version python link_gui.py # Command Line Version python link.py # Song Search Tool python song.py
-
Install Python 3.8+:
- Download from python.org
- Make sure to check "Add Python to PATH" during installation
-
Clone the repository:
git clone https://github.com/ArindamTripathi619/youtubePython.git cd youtubePython -
Run automated installation:
PowerShell -ExecutionPolicy Bypass -File install.ps1
Or manual setup:
-
Install FFmpeg:
winget install ffmpeg
Or follow the official FFmpeg Windows guide
-
Create virtual environment:
python -m venv .venv .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
# GUI Version python link_gui.py # Command Line Version python link.py # Song Search Tool python song.py
python link_gui.py- Enter YouTube URL in the text field
- Select download type (Single Video or Playlist/Channel)
- Choose format (MP3 or MP4)
- Click "Download" and monitor progress
# Single video download
python link.py
# Follow prompts to enter URL and select format
# Song search and download
python song.py
# Enter song names and select from search results# View recent activity
python view_logs.py
# Search for errors
python view_logs.py search ERROR
# View specific number of lines
python view_logs.py 100- Daily log rotation:
logs/youtube_downloader_YYYYMMDD.log - Multiple log levels: INFO, WARNING, ERROR with detailed context
- Thread-safe logging: Safe for concurrent download operations
- UTF-8 encoding: Supports international characters in video titles
# Basic usage
python view_logs.py # Last 50 lines
python view_logs.py 200 # Last 200 lines
python view_logs.py list # List all log files
python view_logs.py search "429" # Search for rate limiting
python view_logs.py search "ERROR" # Find all errors- Rate Limiting (429): YouTube temporary blocks - wait and retry
- Bot Detection: May require cookies or VPN
- Video Unavailable: Private, deleted, or geo-restricted content
- Network Issues: Check internet connection and firewall settings
# In link_gui.py or link.py - modify ydl_opts
ydl_opts = {
'format': 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4', # Best quality MP4
'format': 'bestaudio/best', # Best quality audio for MP3 conversion
'postprocessors': [{
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
'preferredquality': '192' # Adjust quality (128, 192, 320)
}]
}'outtmpl': '%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s' # Playlist organization
'outtmpl': '%(uploader)s - %(title)s.%(ext)s' # Include uploader name- Single video download (MP4 and MP3)
- Playlist download with folder organization
- Search functionality for songs
- Error handling for invalid URLs
- GUI responsiveness during downloads
- Log file creation and content
- Cross-platform compatibility
# Test core functionality
python -m pytest tests/ # If test suite available
# Test imports and dependencies
python -c "import yt_dlp, tkinter; print('All dependencies working')""Module not found" errors:
# Ensure virtual environment is activated
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
# Reinstall dependencies
pip install --upgrade yt-dlp youtube-search-pythonFFmpeg not found:
# Verify FFmpeg installation
ffmpeg -version
# Add FFmpeg to PATH (Windows)
# Add C:\ffmpeg\bin to system PATH environment variableYouTube rate limiting (429 errors):
- Wait 10-15 minutes before retrying
- Use VPN if consistently blocked
- Consider using cookies (see yt-dlp documentation)
GUI not starting:
# Check tkinter availability
python -c "import tkinter; print('tkinter available')"
# On Linux, install tkinter
sudo apt install python3-tk # Ubuntu/Debian
sudo pacman -S tk # Arch LinuxContributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 Python style guidelines
- Add logging for new features
- Test on multiple platforms when possible
- Update documentation for new features
- Ensure error handling is comprehensive
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Arindam Tripathi
For any inquiries, bug reports, or feature requests, feel free to reach out!
- yt-dlp - Powerful YouTube downloader
- youtube-search-python - YouTube search API
- FFmpeg - Media processing framework
- Python tkinter - GUI framework
- YouTube creators for providing amazing content to download
This tool is for educational and personal use only. Please respect YouTube's Terms of Service and copyright laws. Only download content you have permission to download or content that is in the public domain. The developers are not responsible for any misuse of this software.
Thanks for using youtubePython! π
Hope You Like It! π
BYEEEEE π