chore: do not fail resolution if height guessing fails
This commit is contained in:
parent
515ca0a98c
commit
28a8a1554d
1 changed files with 7 additions and 1 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Reference in a new issue