From 149a6a3cdd3dcedea8c83831946229af1e2b4574 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Mon, 23 Mar 2026 22:42:42 +0100 Subject: [PATCH] debug: log yt-dlp stderr to diagnose extraction failures --- app/downloader.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/downloader.py b/app/downloader.py index 8b665ff..38a3a0b 100644 --- a/app/downloader.py +++ b/app/downloader.py @@ -43,8 +43,6 @@ async def extract_audio(url: str) -> Path: cmd = [ "yt-dlp", - "--no-warnings", - "--quiet", "--extract-audio", "--audio-format", "mp3", "--audio-quality", "128K", @@ -64,9 +62,14 @@ async def extract_audio(url: str) -> Path: stderr=asyncio.subprocess.PIPE, ) _, stderr = await proc.communicate() + stderr_text = stderr.decode().strip() + + if stderr_text: + import logging + logging.getLogger(__name__).warning("yt-dlp stderr: %s", stderr_text) if proc.returncode != 0: - raise RuntimeError(stderr.decode().strip() or "yt-dlp failed with no output") + raise RuntimeError(stderr_text or "yt-dlp failed with no output") if expected.exists(): return expected