chore: do not ignore errors on height guessing
This commit is contained in:
parent
f7cf9da686
commit
a189cddd37
1 changed files with 1 additions and 7 deletions
|
|
@ -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])
|
||||
|
|
|
|||
Loading…
Reference in a new issue