A Java-based YouTube video downloader with a modern GUI that supports downloading videos in various qualities including 4K, 1080p, 720p, 480p, and 360p, as well as audio-only formats.
- Multiple Quality Options: Download videos in 4K (2160p), 1080p, 720p, 480p, 360p
- Audio Formats: Extract audio in MP3 or M4A format
- GUI: Clean and intuitive user interface
- Progress Tracking: Real-time download progress with detailed logging
- Standalone Dependencies: No need to install Python or system-wide tools
- Perfect Merging: Automatic video/audio merging with metadata
Run the setup script to automatically download all required dependencies:
.\setup.bat
This will download:
yt-dlp.exe
(standalone - no Python needed)ffmpeg.exe
(for perfect video/audio merging)
.\run.bat
This will:
- Build the application
- Launch the YouTube Downloader GUI
If you prefer to download dependencies manually:
.\download_ytdlp.bat
.\download_ffmpeg.bat
.\build.bat
The application uses:
- yt-dlp: For downloading YouTube videos (standalone executable)
- FFmpeg: For merging video and audio streams with metadata
- Java Swing: For the user interface
- Maven: For building the project
youtube-downloader/
├── src/ # Source code
├── target/ # Built application
├── yt-dlp.exe # Standalone yt-dlp (no Python needed)
├── ffmpeg.exe # FFmpeg for video/audio merging
├── mvn.cmd # Local Maven (optional)
├── setup.bat # Download all dependencies
├── run.bat # Build and run application
├── build.bat # Build only
├── download_ytdlp.bat # Download yt-dlp only
└── download_ffmpeg.bat # Download FFmpeg only
- Java 11 or higher
- Windows 10/11 (tested on Windows)
- Internet connection (for downloading videos and dependencies)
- Launch the application: Run
.\run.bat
- Enter YouTube URL: Paste any YouTube video URL
- Select Quality: Choose from 4K, 1080p, 720p, 480p, 360p, or audio-only
- Choose Output Directory: Select where to save the downloaded file
- Click Download: Watch the progress and detailed logs
- 4K (2160p): Highest quality available (up to 4K)
- 1080p: Full HD quality
- 720p: HD quality
- 480p: Standard definition
- 360p: Low definition
- Audio Only (MP3): Extract audio as MP3
- Audio Only (M4A): Extract audio as M4A
- Best Quality: Automatically select the best available quality
- Run
.\setup.bat
to download dependencies - Or run
.\download_ytdlp.bat
to download yt-dlp only
- Run
.\setup.bat
to download dependencies - Or run
.\download_ffmpeg.bat
to download FFmpeg only
- Install Java 11 or higher from: https://adoptium.net/
- Check the log output for detailed error messages
- Ensure the YouTube URL is valid and accessible
- Try a different quality option
The application uses specific yt-dlp format IDs for reliable quality selection:
- 4K:
315+140/308+140/299+140/298+140/137+140/136+140/135+140/134+140/18
- 1080p:
137+140/136+140/135+140/134+140/18
- 720p:
136+140/135+140/134+140/18
- 480p:
135+140/134+140/18
- 360p:
134+140/18
- Downloads video and audio streams separately
- Uses FFmpeg to merge them into a single MP4 file
- Adds metadata (title, description, etc.)
- Creates a final file with both video and audio
# Clone the repository
git clone https://github.com/up7b8/youtube-downloader.git
cd youtube-downloader
# Download dependencies
.\setup.bat
# Build the project
.\build.bat
# Run the application
java -jar target\youtube-downloader-1.0.0.jar
src/main/java/com/youtubedownloader/
├── YouTubeDownloader.java # Main GUI class
├── DownloadManager.java # Core download logic
├── DownloadFormat.java # Quality format definitions
└── DownloadCallback.java # Progress callback interface
This project is for educational purposes. Please respect YouTube's terms of service and copyright laws when downloading content.
Feel free to submit issues and enhancement requests!