From 0b166304c240f97f6a8ed52fc5e1c35ffa6bccde Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Wed, 9 Sep 2026 02:07:02 +0300 Subject: [PATCH] Log why a track falls back to audio-only Whether a clip gets a picture is decided by a format lookup whose failure was only logged at debug, so an audio-only fallback was indistinguishable from video being broken. The reason is now visible at the default log level, and taking the video path says so too. Co-Authored-By: Claude Opus 5 --- src/sources/ytdlp.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/sources/ytdlp.ts b/src/sources/ytdlp.ts index a7eae19..46dc9b4 100644 --- a/src/sources/ytdlp.ts +++ b/src/sources/ytdlp.ts @@ -363,9 +363,17 @@ export async function hasProgressiveVideo(pageUrl: string, maxHeight: number): P "%(format_id)s", pageUrl, ]); - return stdout.trim().length > 0; + const formatId = stdout.trim(); + if (!formatId) { + log.warn({ pageUrl }, "no progressive format offered, playing audio only"); + return false; + } + log.info({ pageUrl, formatId }, "progressive format for video playback"); + return true; } catch (err) { - log.debug({ err, pageUrl }, "no progressive format for video playback"); + // Worth seeing: this is the difference between "clip plays" and "sound only". + const reason = err instanceof Error ? err.message : String(err); + log.warn({ pageUrl, reason }, "format lookup failed, playing audio only"); return false; } }