From 5cec284cd654bdff108316effb401e3c8c5e9716 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Wed, 2 Sep 2026 18:31:13 +0700 Subject: [PATCH] fix(youtube): filter broken formats, use bestvideo+bestaudio for merged output - Change format string from bestvideo (video-only) to bestvideo+bestaudio so the primary result has both video and audio streams - Add --merge-output-format mp4 for clean container output - Skip m3u8/hls_native, m4a, mhtml formats (unusable individual streams) - Only expose direct HTTPS URLs (skip non-http protocol URLs) - Remove Audio media type variant from YouTube path (video+audio merged) Root cause: YouTube DASH provides video-only and audio-only separate formats. Old code used bestvideo format selector (video-only) and returned ALL format URLs including broken ones. Fix: use merged format selector + filter list. --- src/infrastructure/repository/downloader.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/infrastructure/repository/downloader.rs b/src/infrastructure/repository/downloader.rs index 831ed60..797e344 100644 --- a/src/infrastructure/repository/downloader.rs +++ b/src/infrastructure/repository/downloader.rs @@ -1425,11 +1425,12 @@ pub async fn fetch_youtube_mp4(url: &str, quality: &str) -> Result Result