From 4ab8245a930a8feea9f9075f5acf21880ac51343 Mon Sep 17 00:00:00 2001 From: inputnoise Date: Mon, 25 May 2026 21:42:02 +0200 Subject: [PATCH] Debug: log fetch_video_metadata cookie args and errors Co-Authored-By: Claude Sonnet 4.6 --- backend/services/ytdlp.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/services/ytdlp.py b/backend/services/ytdlp.py index 04c8949..b356df7 100644 --- a/backend/services/ytdlp.py +++ b/backend/services/ytdlp.py @@ -211,16 +211,19 @@ def _best_thumbnail(thumbnails: list | None) -> str | None: def fetch_video_metadata(video_id: str) -> dict | None: """Fetch metadata for a single video by YouTube ID.""" url = f"https://www.youtube.com/watch?v={video_id}" - stdout, _, code = _run([ + cookie_args = _cookie_args() + print(f"[fetch_meta] video={video_id} cookie_args={cookie_args!r}", flush=True) + stdout, stderr, code = _run([ "yt-dlp", url, "--dump-json", "--no-download", "--no-playlist", - "--quiet", "--extractor-args", "youtube:player_client=ios,web", - *_cookie_args(), + *cookie_args, ], timeout=30) + if code != 0: + print(f"[fetch_meta] FAILED code={code} stderr={stderr[:500]!r}", flush=True) for line in stdout.splitlines(): line = line.strip()