chore: do not ignore errors on height guessing

This commit is contained in:
WebStreamr 2026-01-14 11:51:32 +00:00
parent f7cf9da686
commit a189cddd37
No known key found for this signature in database

View file

@ -2,13 +2,7 @@ import { Context } from '../types';
import { CustomRequestConfig, Fetcher } from './Fetcher';
export const guessHeightFromPlaylist = async (ctx: Context, fetcher: Fetcher, playlistUrl: URL, init?: CustomRequestConfig): Promise<number | undefined> => {
let m3u8Data: string;
try {
m3u8Data = await fetcher.text(ctx, playlistUrl, init);
} catch {
/* istanbul ignore next */
return undefined;
}
const m3u8Data = await fetcher.text(ctx, playlistUrl, init);
const heights = Array.from(m3u8Data.matchAll(/\d+x(\d+)|(\d+)p/g))
.map(heightMatch => heightMatch[1] ?? heightMatch[2])