This entire project was 100% vibe coded - a testament to the raw creative energy that flows when developers embrace the aesthetic of retro computing and the pure joy of building something meaningful. Every line of code, every feature, and every design decision was infused with the nostalgic essence of computing's golden age.
π Dedicated with infinite respect to the honorable Zachary Hanif π
A visionary who understands that the best code isn't just functional - it's got soul.
"Now remember, kids, the internet is serious business." - Isaac Asimov (probably)
But sometimes... sometimes you just gotta vibe. π
A powerful Rust-based application for downloading and encoding YouTube videos with both command-line and graphical user interfaces.
β
FULLY FUNCTIONAL - All compilation errors resolved
β
HIGH-QUALITY DOWNLOADS - Automatic 1080p downloads with adaptive encoding
β
CLI Interface - Working with full argument parsing
β
GUI Interface - Builds and launches successfully
β
ADAPTIVE ENCODING - Preserves source quality automatically
- π¬ High-Quality Downloads: Automatically downloads the highest available quality (up to 1080p) using yt-dlp
- π§ Adaptive Encoding: New
mp4_adaptivepreset preserves source resolution and quality automatically - β‘ Smart Fallback: Multiple download strategies to bypass YouTube throttling
- π― Dual Interface: Both CLI and GUI applications for different use cases
- π Progress Tracking: Real-time progress reporting with speed and ETA information
- π Hardware Acceleration: Automatic detection and use of GPU acceleration when available
- βοΈ Flexible Configuration: Comprehensive configuration system with TOML files
- π‘οΈ Error Recovery: Robust error handling with user-friendly suggestions
- π« Cancellation Support: Graceful cancellation of long-running operations
Before using yt-dler, ensure you have the following dependencies installed:
-
yt-dlp: For downloading YouTube videos
# Install via pip (recommended) pip install yt-dlp # Or via pipx (isolated installation) pipx install yt-dlp
-
FFmpeg: For video encoding and processing
- Ubuntu/Debian:
sudo apt install ffmpeg - macOS:
brew install ffmpeg - Windows: Download from FFmpeg official site
- Arch Linux:
sudo pacman -S ffmpeg - Fedora/RHEL:
sudo dnf install ffmpeg
- Ubuntu/Debian:
Check if dependencies are installed correctly:
# Build and test dependency checking
cargo build
cargo run --bin yt-dler-cli -- --check-depsExpected output when dependencies are missing:
π Checking dependencies...
β Missing dependencies:
β’ yt-dlp
β’ ffmpeg
β’ ffprobe
π‘ Installation suggestions:
Install yt-dlp: pip install yt-dlp
Install FFmpeg: https://ffmpeg.org/download.html
-
Prerequisites:
- Rust 1.70+ (install via rustup.rs)
- Git
-
Clone the repository:
git clone <repository-url> cd yt-dler
-
Build the project:
# Debug build (faster compilation) cargo build # Release build (optimized) cargo build --release
-
Install binaries (optional):
cargo install --path .
After building, binaries are located in:
- Debug:
target/debug/yt-dler-cliandtarget/debug/yt-dler-gui - Release:
target/release/yt-dler-cliandtarget/release/yt-dler-gui
Check dependencies first:
./target/release/yt-dler-cli --check-deps⨠Download in highest quality with adaptive encoding (NEW DEFAULT):
# Downloads at best available quality (up to 1080p) and encodes to MP4 preserving source resolution
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4"
# Result: Full 1080p MP4 maintaining source quality automatically!π¬ Example Downloads:
1080p Movie Clip Example:
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4"
# Downloads and encodes to 1920x1080 MP4 (or source resolution if different)4K Content Example:
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=vsjK7AVmsL8"
# Downloads best available quality, preserves 4K if availableDownload only (skip encoding):
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --download-onlyπ NEW: Adaptive Preset (Default)
mp4_adaptive- DEFAULT: Preserves source resolution and quality automatically- Uses CRF 18 for near-lossless quality
- H.264 + AAC encoding for maximum compatibility
- No downscaling - maintains original resolution
- Perfect for preserving high-quality downloads
Standard Presets:
- Video Presets:
mp4_480p,mp4_720p,mp4_1080p,mp4_1440p,mp4_4k - WebM Presets:
webm_720p,webm_1080p - Audio Only:
audio_mp3,audio_aac
Custom preset selection:
# Force specific resolution (will downscale if needed)
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --preset mp4_720p
# 4K encoding (if source supports it)
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=vsjK7AVmsL8" --preset mp4_4k
# Extract audio only
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --preset audio_mp3Other options:
# Custom output directory
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --output /path/to/downloads
# Quiet mode (no progress bars)
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --quiet
# Verbose output
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --verbose
# Custom configuration file
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --config /path/to/config.toml| Preset | Encoding Speed | Quality | Hardware Accel | Best For |
|---|---|---|---|---|
mp4_adaptive |
Medium | Highest | β Yes | Archive/Best quality |
mp4_1080p |
Fast | High | β Yes | Standard high-def |
mp4_720p |
Faster | Good | β Yes | Balanced performance |
audio_only |
Fastest | N/A | β No | Audio extraction |
./target/release/yt-dler-cli --helpLaunch the GUI application:
cargo run --bin yt-dler-gui
# or
./target/release/yt-dler-gui- Intuitive Interface: Simple form-based input for URLs and settings
- π Adaptive Preset: Now defaults to
mp4_adaptivefor best quality - Real-time Progress: Visual progress bars with speed and ETA
- Quality Selection: Choose from multiple video quality and preset options
- Output Management: Select custom output directories
- Error Display: Clear error messages with troubleshooting suggestions
- Configuration: Access to all application settings via GUI
Default configuration with new adaptive behavior:
[download]
video_quality = "best" # Downloads highest available quality
extract_audio = false
keep_video_after_audio_extract = true
[encoding]
default_preset = "mp4_adaptive" # NEW: Preserves source quality
use_hardware_acceleration = true
max_concurrent_jobs = 4
[output]
default_directory = "YouTube Downloads"
organize_by_date = false
keep_original_after_encoding = false
[ui]
theme = "dark"
show_advanced_options = false
[advanced]
verbose_output = false
temp_directory = ""
cleanup_after_encoding = trueCreate custom configuration:
# Generate default config
./target/release/yt-dler-cli --generate-config > config.toml
# Use custom config
./target/release/yt-dler-cli "https://www.youtube.com/watch?v=Bmz67ErIRa4" --config config.toml# Debug build (faster compilation, includes debug symbols)
cargo build
# Release build (optimized, smaller size)
cargo build --release
# Run tests
cargo test
# Check code formatting
cargo fmt --check
# Run linter
cargo clippy -- -D warnings
# Fix formatting automatically
cargo fmt- tokio: Async runtime for concurrent operations
- clap: Command-line argument parsing
- eframe/egui: Cross-platform GUI framework
- serde: Serialization for configuration management
- yt-dlp: External tool for YouTube video downloading
- FFmpeg: External tool for video encoding and processing
src/
βββ lib.rs # Core library and YtDler struct
βββ config.rs # Configuration management
βββ downloader.rs # YouTube download logic with yt-dlp
βββ encoder.rs # Video encoding with FFmpeg
βββ progress.rs # Progress reporting system
βββ error.rs # Error types and handling
βββ gui.rs # GUI implementation with egui
βββ bin/
βββ cli.rs # Command-line interface
βββ gui.rs # GUI application entry point
yt-dler provides comprehensive error handling with user-friendly messages:
-
Missing Dependencies
Error: Missing dependencies Solution: Install yt-dlp and FFmpeg (see Prerequisites) Check: ./target/release/yt-dler-cli --check-deps -
Network Errors
Error: Network timeout or connection failed Solution: Check internet connection and try again Note: yt-dler has multiple fallback strategies for YouTube throttling -
Invalid URLs
Error: Invalid YouTube URL Solution: Ensure URL format is correct (youtube.com or youtu.be) Example: https://www.youtube.com/watch?v=Bmz67ErIRa4 -
Quality Not Available
Error: Requested quality not available Solution: Use adaptive preset or check available qualities Note: mp4_adaptive automatically adapts to best available -
Disk Space
Error: Insufficient disk space Solution: Free up space or choose different output directory Note: Adaptive encoding produces larger files for better quality -
Permissions
Error: Permission denied Solution: Ensure write access to output directory
- Review error messages carefully (they include suggestions)
- Enable verbose output with
--verbose - Check this README for common solutions
- Verify external dependencies are properly installed
- Test with example URLs provided in this README
yt-dler automatically detects and uses hardware acceleration when available:
- NVIDIA: CUDA/NVENC encoding (major performance boost)
- Intel: Quick Sync Video (QSV)
- AMD: Video Acceleration API (VAAPI)
- Use hardware acceleration (enabled by default)
- Choose appropriate presets (adaptive = best quality, 720p = faster)
- Use SSD storage for temporary files
- Ensure sufficient RAM for large video files (especially 4K)
- Modern CPU benefits adaptive encoding CRF calculations
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following Rust best practices
- Add tests as needed
- Ensure code passes
cargo clippyandcargo test - Submit a pull request
- Follow Rust naming conventions (use
cargo fmt) - Add comprehensive comments and documentation
- Include error handling for all operations
- Write tests for new functionality
- Use
#[derive(Debug)]for custom types - Prefer
Result<T, E>over panics
This project is licensed under the MIT License - see the LICENSE file for details.
- yt-dlp: Powerful YouTube video downloader and successor to youtube-dl
- FFmpeg: Comprehensive multimedia processing framework
- egui: Immediate mode GUI framework for Rust
- Rust Community: Excellent ecosystem, tools, and documentation
- Tokio: Asynchronous runtime for Rust
- Rust version: Ensure Rust 1.70+ is installed
- Dependencies: Update with
cargo update - Clean build: Try
cargo clean && cargo build
- Check dependencies:
./target/release/yt-dler-cli --check-deps - Verify URLs: Test with provided example URLs
- Check permissions: Ensure write access to output directory
- Free space: Verify sufficient disk space (adaptive encoding uses more space)
- Hardware accel: Check if GPU drivers are properly installed
- π NEW:
mp4_adaptivepreset for source-quality preservation - π NEW: Automatic 1080p downloads with adaptive encoding as default
- β Enhanced download quality selection with proper DASH stream handling
- β Improved fallback strategies for YouTube throttling bypass
- β Updated CLI and GUI to use adaptive encoding by default
- β Better quality preservation - no more unnecessary downscaling
- β CRF 18 encoding for near-lossless quality
- β Source resolution preservation (1728x1080, 4K, etc.)
- β Initial release with working CLI and GUI
- β Download and encoding functionality
- β Configuration management system
- β Progress reporting with real-time updates
- β Comprehensive error handling and recovery
- β Hardware acceleration support
- β Cross-platform compatibility (Linux, macOS, Windows)
- β External dependency validation
- β Multiple encoding presets and quality options
- π§ Fixed YouTube quality parameter propagation through fallback strategies
- π§ Resolved all compilation errors and build issues
- π§ Enhanced ProgressReporter trait implementation
- π§ Improved download success rate with better client spoofing
- π§ Added adaptive encoding that preserves source video quality
- π§ Updated default behavior to automatically use best practices

