Skip to content

Refactor/v2 restructure#10

Merged
Rashed-alothman merged 2 commits intomainfrom
refactor/v2-restructure
Mar 6, 2026
Merged

Refactor/v2 restructure#10
Rashed-alothman merged 2 commits intomainfrom
refactor/v2-restructure

Conversation

@Rashed-alothman
Copy link
Owner

No description provided.

Rashed-alothman and others added 2 commits March 5, 2026 13:30
- Fix audio quality mapping: "best" now correctly maps to highest quality
  instead of hardcoded 192kbps, using new AUDIO_QUALITY_MAP
- Add --video-codec option (h264/h265/vp9/av1/auto) with format filter
  fallback chains via VIDEO_CODEC_PREFERENCE
- Wire --enhance-audio flag to EnhancedAudioProcessor with full preset
  and per-flag support (noise reduction, stereo widening, etc.)
- Fix _needs_audio_processing to detect all individual enhancement flags
- Throttle progress output to max 1 update/second with ETA display
- Expand interactive mode with smart input parsing: supports URL+format,
  URL+resolution, format-first syntax (e.g. "flac URL", "URL 1080")
- Use COMPREHENSIVE_BESTAUDIO_FORMAT for better audio source selection
- Support named resolutions (4k, 2k, hd, sd) in format selection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Critical bug fixes:
- Fix NameError crash: add missing `import tempfile` in config.py
- Fix RuntimeError crash: replace all asyncio.run() in SessionManager
  with _run_async_save() that detects running event loops safely
- Fix AttributeError: config.py test_functionality() now properly
  calls async initialize_config_async() with asyncio.run()
- Remove duplicate exception class definitions in manager.py (DownloadError,
  NetworkError, ResourceError defined twice), consolidate into single hierarchy
- Fix dead code in session.py (logging after continue), fix malformed line

Download core improvements:
- Replace console.print() flood with Rich Progress bar in _download_single_url
- Add merge_output_format='mp4' for proper video+audio container merging
- Add FFmpeg location, retry config, and fragment settings to ydl_opts
- Show title and format info before download starts
- Handle audio file extension changes after FFmpegExtractAudio post-processing
- User-friendly error messages for common yt-dlp failures (403, unavailable, etc.)
- Better download result reporting with file sizes

Audio pipeline fixes:
- Lossless formats (FLAC/WAV) now force quality=0 for best source
- Add FFmpegMetadata and EmbedThumbnail post-processors for audio downloads
- All individual enhancement flags (noise_reduction, stereo_widening, etc.)
  now properly trigger enhance_audio umbrella and process_audio pipeline

Video upscaling fixes:
- VideoUpscaler now always initialized (was gated behind config flag,
  so --upscale CLI flag never worked)
- Real-ESRGAN frame extraction now uses source fps instead of hardcoded 30
- Fix NameError in finally block when frames_dir/upscaled_dir not yet created
- Add quality preset mapping (CRF/preset) to FFmpeg upscaler
- Log stderr on failure for better debugging

Interactive mode UX:
- Welcome panel with quick-reference commands on entering interactive mode
- Rich Table-based help display instead of raw prints
- Support 'upscale', '2x'/'4x', 'enhance', 'denoise' keywords in smart parser
- Preserve URL case sensitivity (don't lowercase URLs)
- Handle EOFError gracefully, add 'snatch>' prompt
- Show upscale/enhance/denoise info in download summary

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Rashed-alothman Rashed-alothman merged commit 7294b4c into main Mar 6, 2026
2 checks passed
@github-actions
Copy link

github-actions bot commented Mar 6, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@Rashed-alothman Rashed-alothman self-assigned this Mar 6, 2026
@Rashed-alothman Rashed-alothman added the enhancement New feature or request label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant