From 8a55fd91a4fe117286041375f773ab8144ea49de Mon Sep 17 00:00:00 2001 From: asepharyana Date: Wed, 2 Sep 2026 18:46:13 +0700 Subject: [PATCH] fix(youtube): filter m3u8/hls protocol streams + check requested_formats - Filter by protocol (m3u8_native) not just ext (m3u8) since yt-dlp returns ext=mp4 with protocol=m3u8_native for HLS streams - Check requested_formats before formats[]: when yt-dlp uses a merged format selector, the actual URLs are in requested_formats, while formats[] is the full list of all individual format IDs - In requested_formats branch, use vcodec/acodec to classify formats correctly (video-only, audio-only, or muxed) --- src/infrastructure/repository/downloader.rs | 77 +++++++++++++++++++-- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/src/infrastructure/repository/downloader.rs b/src/infrastructure/repository/downloader.rs index 797e344..5ac09df 100644 --- a/src/infrastructure/repository/downloader.rs +++ b/src/infrastructure/repository/downloader.rs @@ -1456,22 +1456,87 @@ pub async fn fetch_youtube_mp4(url: &str, quality: &str) -> Result