# ๐ŸŽค Karaoke Video Downloader A Python-based Windows CLI tool to download karaoke videos from YouTube channels/playlists using `yt-dlp.exe`, with advanced tracking, songlist prioritization, and flexible configuration. ## โœจ Features - ๐ŸŽต **Channel & Playlist Downloads**: Download all videos from a YouTube channel or playlist - ๐Ÿ“‚ **Organized Storage**: Each channel gets its own folder in `downloads/` - ๐Ÿ“ **Robust Tracking**: Tracks all downloads, statuses, and formats in JSON - ๐Ÿ† **Songlist Prioritization**: Prioritize or restrict downloads to a custom songlist - ๐Ÿ”„ **Batch Saving & Caching**: Efficient, minimizes API calls - ๐Ÿท๏ธ **ID3 Tagging**: Adds artist/title metadata to MP4 files - ๐Ÿงน **Automatic Cleanup**: Removes extra yt-dlp files - ๐Ÿ“ˆ **Real-Time Progress**: Detailed console and log output - ๐Ÿงน **Reset/Clear Channel**: Reset all tracking and files for a channel, or clear channel cache via CLI - ๐Ÿ—‚๏ธ **Latest-per-channel download**: Download the latest N videos from each channel in a single batch, with a per-channel download plan, robust resume, and unique plan cache. Use --latest-per-channel and --limit N. ## ๐Ÿ“‹ Requirements - **Windows 10/11** - **Python 3.7+** - **yt-dlp.exe** (in `downloader/`) - **mutagen** (for ID3 tagging, optional) ## ๐Ÿš€ Quick Start ### Download a Channel ```bash python download_karaoke.py https://www.youtube.com/@SingKingKaraoke/videos ``` ### Download from a List of Channels ```bash python download_karaoke.py --file data/channels.txt ``` ### Download Only Songlist Songs ```bash python download_karaoke.py --songlist-only ``` ### Prioritize Songlist in Download Queue ```bash python download_karaoke.py --songlist-priority ``` ### Show Songlist Download Progress ```bash python download_karaoke.py --songlist-status ``` ### Limit Number of Downloads ```bash python download_karaoke.py --limit 5 ``` ### Override Resolution ```bash python download_karaoke.py --resolution 1080p ``` ### Download Latest N Videos Per Channel ```bash python download_karaoke.py --file data/channels.txt --latest-per-channel --limit 5 ``` ### **Reset/Start Over for a Channel** ```bash python download_karaoke.py --reset-channel SingKingKaraoke ``` ### **Reset Channel and Songlist Songs** ```bash python download_karaoke.py --reset-channel SingKingKaraoke --reset-songlist ``` ### **Clear Channel Cache** ```bash python download_karaoke.py --clear-cache SingKingKaraoke python download_karaoke.py --clear-cache all ``` ## ๐Ÿง  Songlist Integration - Place your prioritized song list in `data/songList.json` (see example format below). - The tool will match and prioritize these songs across all available channel videos. - Use `--songlist-only` to download only these songs, or `--songlist-priority` to prioritize them in the queue. - Download progress for the songlist is tracked globally in `data/songlist_tracking.json`. #### Example `data/songList.json` ```json [ { "artist": "Taylor Swift", "title": "Cruel Summer" }, { "artist": "Billie Eilish", "title": "Happier Than Ever" } ] ``` ## ๐Ÿ› ๏ธ Tracking & Caching - **data/karaoke_tracking.json**: Tracks all downloads, statuses, and formats - **data/songlist_tracking.json**: Tracks global songlist download progress - **data/channel_cache.json**: Caches channel video lists for performance ## ๐Ÿ“‚ Folder Structure ``` KaroakeVideoDownloader/ โ”œโ”€โ”€ karaoke_downloader/ # All core Python code and utilities โ”‚ โ”œโ”€โ”€ downloader.py # Main downloader class โ”‚ โ”œโ”€โ”€ cli.py # CLI entry point โ”‚ โ”œโ”€โ”€ id3_utils.py # ID3 tagging helpers โ”‚ โ”œโ”€โ”€ songlist_manager.py # Songlist logic โ”‚ โ”œโ”€โ”€ youtube_utils.py # YouTube helpers โ”‚ โ”œโ”€โ”€ tracking_manager.py # Tracking logic โ”‚ โ”œโ”€โ”€ check_resolution.py # Resolution checker utility โ”‚ โ”œโ”€โ”€ resolution_cli.py # Resolution config CLI โ”‚ โ””โ”€โ”€ tracking_cli.py # Tracking management CLI โ”œโ”€โ”€ data/ # All config, tracking, cache, and songlist files โ”‚ โ”œโ”€โ”€ config.json โ”‚ โ”œโ”€โ”€ karaoke_tracking.json โ”‚ โ”œโ”€โ”€ songlist_tracking.json โ”‚ โ”œโ”€โ”€ channel_cache.json โ”‚ โ”œโ”€โ”€ channels.txt โ”‚ โ””โ”€โ”€ songList.json โ”œโ”€โ”€ downloads/ # All video output โ”‚ โ””โ”€โ”€ [ChannelName]/ # Per-channel folders โ”œโ”€โ”€ logs/ # Download logs โ”œโ”€โ”€ downloader/yt-dlp.exe # yt-dlp binary โ”œโ”€โ”€ tests/ # Diagnostic and test scripts โ”‚ โ””โ”€โ”€ test_installation.py โ”œโ”€โ”€ download_karaoke.py # Main entry point (thin wrapper) โ”œโ”€โ”€ README.md โ”œโ”€โ”€ PRD.md โ”œโ”€โ”€ requirements.txt โ””โ”€โ”€ download_karaoke.bat # (optional Windows launcher) ``` ## ๐Ÿšฆ CLI Options - `--file `: Download from a list of channels - `--songlist-priority`: Prioritize songlist songs in download queue - `--songlist-only`: Download only songs from the songlist - `--songlist-status`: Show songlist download progress - `--limit `: Limit number of downloads - `--resolution <720p|1080p|...>`: Override resolution - `--status`: Show download/tracking status - `--reset-channel `: **Reset all tracking and files for a channel** - `--reset-songlist`: **When used with --reset-channel, also reset songlist songs for this channel** - `--clear-cache `: **Clear channel video cache for a specific channel or all** - `--latest-per-channel`: **Download the latest N videos from each channel (use with --limit)** ## ๐Ÿ“ Example Usage ```bash python download_karaoke.py https://www.youtube.com/@SingKingKaraoke/videos --songlist-priority --limit 10 python download_karaoke.py --file data/channels.txt --songlist-only python download_karaoke.py --songlist-status python download_karaoke.py --reset-channel SingKingKaraoke python download_karaoke.py --reset-channel SingKingKaraoke --reset-songlist python download_karaoke.py --clear-cache all ``` ## ๐Ÿท๏ธ ID3 Tagging - Adds artist/title/album/genre to MP4 files using mutagen (if installed) ## ๐Ÿงน Cleanup - Removes `.info.json` and `.meta` files after download ## ๐Ÿ› ๏ธ Configuration - All options are in `data/config.json` (format, resolution, metadata, etc.) - You can edit this file or use CLI flags to override ## ๐Ÿž Troubleshooting - Ensure `yt-dlp.exe` is in the `downloader/` folder - Check `logs/` for error details - Use `python -m karaoke_downloader.check_resolution` to verify video quality --- **Happy Karaoke! ๐ŸŽค**