From 28a8a1554d1c14eb85577e73191a325cc686f22a Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 9 Jan 2026 20:00:46 +0000 Subject: [PATCH] chore: do not fail resolution if height guessing fails --- src/utils/height.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/utils/height.ts b/src/utils/height.ts index 21775d7..6c7a170 100644 --- a/src/utils/height.ts +++ b/src/utils/height.ts @@ -17,7 +17,13 @@ export const guessHeightFromPlaylist = async (ctx: Context, fetcher: Fetcher, pl return height; } - const m3u8Data = await fetcher.text(ctx, playlistUrl, init); + let m3u8Data: string; + try { + m3u8Data = await fetcher.text(ctx, playlistUrl, init); + } catch { + /* istanbul ignore next */ + return undefined; + } const heights = Array.from(m3u8Data.matchAll(/\d+x(\d+)|(\d+)p/g)) .map(heightMatch => heightMatch[1] ?? heightMatch[2])