A powerful, cross-platform command-line tool for downloading YouTube videos with advanced features including collection management, authentication support, and transcript downloading.
- ๐ฅ Download Videos - Single videos, playlists, or entire channels
- ๐ Transcript Support - Download subtitles and auto-generated captions in multiple languages
- ๐๏ธ Collection Management - SQLite-based local library with metadata tracking
- ๐ Authentication - Support for age-restricted and private videos via cookies
- ๐จ Quality Selection - Choose specific resolutions (1080p, 720p, etc.) or formats (mp4, webm, mkv)
- ๐ Search & Filter - Query your local collection with powerful search
- ๐ Statistics - Track your collection size, downloads, and more
- ๐ชต Enhanced Debugging - Comprehensive logging and error diagnostics
- ๐ฅ๏ธ Cross-Platform - Works seamlessly on Windows, macOS, and Linux
- โก Professional CLI - Built with Click and Rich for beautiful terminal UI
- Python 3.8 or higher
- ffmpeg (for merging video/audio streams)
- yt-dlp (installed automatically)
# Clone the repository
git clone https://github.com/yourusername/youtuber.git
cd youtuber
# Run setup script
# Windows:
.\setup.ps1
# macOS/Linux:
chmod +x setup.sh
./setup.sh# Clone and navigate
git clone https://github.com/yourusername/youtuber.git
cd youtuber
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install package
pip install -e .Windows (using winget):
winget install Gyan.FFmpegmacOS (using Homebrew):
brew install ffmpegLinux (Ubuntu/Debian):
sudo apt install ffmpeg# Download a video (default quality: best)
youtuber download https://www.youtube.com/watch?v=VIDEO_ID
# Download with specific quality
youtuber download https://www.youtube.com/watch?v=VIDEO_ID --quality 1080p
# Download with transcripts
youtuber download https://www.youtube.com/watch?v=VIDEO_ID --transcripts
# Download entire playlist
youtuber download https://www.youtube.com/playlist?list=PLAYLIST_ID --playlist# Using browser cookies
youtuber download URL --cookies-from-browser chrome
# Using exported cookies file
youtuber download URL --cookies cookies.txt# List all downloaded videos
youtuber list
# Search your collection
youtuber search "python tutorial"
# View statistics
youtuber stats
# Get video info without downloading
youtuber info https://www.youtube.com/watch?v=VIDEO_ID# View current configuration
youtuber config list
# Set default download directory
youtuber config set download_dir "C:\Videos"
# Set default quality
youtuber config set default_quality 1080p
# View all paths
youtuber pathsyoutuber download URL [OPTIONS]
Options:
-q, --quality TEXT Video quality (best, 1080p, 720p, 480p, 360p, audio)
-f, --format TEXT Output format (mp4, mkv, webm)
-o, --output-dir PATH Custom download directory
-t, --transcripts Download subtitles/transcripts
-l, --transcript-lang TEXT Transcript languages (default: en)
-p, --playlist Download entire playlist
-u, --username TEXT YouTube account username/email
-pw, --password TEXT YouTube account password
-c, --cookies PATH Path to cookies.txt file
-cfb, --cookies-from-browser [chrome|firefox|edge|safari|opera|brave]
Extract cookies from browser
-v, --verbose Enable verbose logging
-d, --debug Enable debug mode
--no-collection Skip adding to collection databaseyoutuber list [OPTIONS]
Options:
--sort-by TEXT Sort by: date, title, size (default: date)
--limit INTEGER Maximum number of videos to showyoutuber search QUERY [OPTIONS]
Options:
--limit INTEGER Maximum results to showyoutuber info URL [OPTIONS]
Options:
-v, --verbose Show detailed information# List all settings
youtuber config list
# Get specific setting
youtuber config get SETTING_NAME
# Set a value
youtuber config set SETTING_NAME VALUE
# Reset to defaults
youtuber config resetyoutuber statsyoutuber paths- No data collection - All data stays on your machine
- Sensitive files protected -
.gitignoreprevents committing cookies, configs, and downloads - Cookie encryption - When using
--cookies-from-browser, relies on browser's native encryption - No API keys required - Uses yt-dlp's direct extraction
- Never commit
cookies.txtorconfig.jsonfiles - Clear cookies when done if using shared machine:
rm cookies.txt - Use environment-specific configs for different machines
YouTuber/
โโโ youtuber/ # Main package
โ โโโ __init__.py # Package initialization
โ โโโ __main__.py # Entry point
โ โโโ cli.py # CLI commands (Click)
โ โโโ downloader.py # YouTube download logic (yt-dlp)
โ โโโ collection.py # SQLite collection management
โ โโโ config.py # Configuration management
โ โโโ logger.py # Enhanced logging system
โ โโโ platform_utils.py # Cross-platform utilities
โโโ tests/ # Test suite
โ โโโ test_youtuber.py # Unit tests
โโโ docs/ # Documentation
โโโ setup.py # Package setup
โโโ pyproject.toml # Build configuration
โโโ requirements.txt # Dependencies
โโโ README.md # This file
# Run all tests
pytest
# Run with coverage
pytest --cov=youtuber tests/
# Run specific test
pytest tests/test_youtuber.py::test_config# Install in development mode with dev dependencies
pip install -e ".[dev]"
# Run linter
flake8 youtuber/
# Format code
black youtuber/Install ffmpeg (see Installation section)
Close your browser completely before running with --cookies-from-browser
Some videos require authentication. Use --cookies-from-browser or --cookies:
youtuber download URL --cookies-from-browser chromeRun PowerShell as Administrator for first-time setup
MIT License - see LICENSE file for details
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your 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
- yt-dlp - The excellent YouTube downloader
- Click - Beautiful CLI framework
- Rich - Terminal formatting and UI
For issues, questions, or suggestions, please open an issue on GitHub.
This tool is for personal use only. Respect copyright laws and YouTube's Terms of Service. Only download videos you have the right to download.
Made with โค๏ธ for the community
black src/ tests/mypy src/flake8 src/ tests/- Python 3.8 or higher
- ffmpeg (optional, for format conversion)
MIT License - see LICENSE file for details
Video unavailable: Check if video is region-restricted or requires authentication
Download fails: Update yt-dlp: pip install --upgrade yt-dlp
Permission errors: Check write permissions in download directory
FFmpeg not found: Install ffmpeg for format conversion support
Contributions are welcome! Please feel free to submit a Pull Request.