Debug: log fetch_video_metadata cookie args and errors
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -211,16 +211,19 @@ def _best_thumbnail(thumbnails: list | None) -> str | None:
|
|||||||
def fetch_video_metadata(video_id: str) -> dict | None:
|
def fetch_video_metadata(video_id: str) -> dict | None:
|
||||||
"""Fetch metadata for a single video by YouTube ID."""
|
"""Fetch metadata for a single video by YouTube ID."""
|
||||||
url = f"https://www.youtube.com/watch?v={video_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",
|
"yt-dlp",
|
||||||
url,
|
url,
|
||||||
"--dump-json",
|
"--dump-json",
|
||||||
"--no-download",
|
"--no-download",
|
||||||
"--no-playlist",
|
"--no-playlist",
|
||||||
"--quiet",
|
|
||||||
"--extractor-args", "youtube:player_client=ios,web",
|
"--extractor-args", "youtube:player_client=ios,web",
|
||||||
*_cookie_args(),
|
*cookie_args,
|
||||||
], timeout=30)
|
], timeout=30)
|
||||||
|
if code != 0:
|
||||||
|
print(f"[fetch_meta] FAILED code={code} stderr={stderr[:500]!r}", flush=True)
|
||||||
|
|
||||||
for line in stdout.splitlines():
|
for line in stdout.splitlines():
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user