fix(extractor): handle missing height infos in playlist properly
This commit is contained in:
parent
dd121a068a
commit
3a28de46bd
5 changed files with 1391 additions and 1 deletions
|
|
@ -17,4 +17,8 @@ describe('Soaper', () => {
|
|||
test('Black Mirror', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://soaper.live/episode_5KDq78eGp1.html'), CountryCode.en, 'Black Mirror 4x2')).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('last of us s2e3', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://soaper.live/episode_rYg3vMEDL1.html'), CountryCode.de, 'The Last of Us 2x3')).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1 @@
|
|||
{"key":true,"val":"\/home\/index\/TVM3U8?key=LrezaYpLOxT4O61m8e3mSLdBzLNyRaf8zPmERxvwh1Mrj6zbVEUvAzRv2KZLu5PVvRKqwbcz6qmb9vbOi3wQZ4ae8RsZ9N3Jm9Yatw4yE55bBp.m3u8","vtt":"https:\/\/ttt5.randchange.top\/\/hls\/2023\/last_of_us\/Season2\/3\/vtt\/\/thumb.vtt","val_bak":"\/home\/index\/TVM3U8?key=LrezaYpLOxT4O61m8e3mSLdBzLNyRaf8zPmERxvwh1Mrj6zbVEUvAzRv2KZLu5PVvRKqwbcz6qmb9vbOi3wQZ4ae8RsZ9N3Jm9Yatw4yE55bBp.m3u8","pos":0,"type":"m3u8","subs":null,"prev_epi_title":"[S2E2] Through the Valley","prev_epi_url":"\/episode_dZkrY8nG6z.html?ap=1","next_epi_title":"[S2E4] Day One","next_epi_url":"\/episode_OMkKZ9WGLq.html?ap=1"}
|
||||
|
|
@ -31,3 +31,18 @@ exports[`Soaper Full Metal Jacket 1`] = `
|
|||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Soaper last of us s2e3 1`] = `
|
||||
[
|
||||
{
|
||||
"label": "Soaper",
|
||||
"meta": {
|
||||
"countryCode": "de",
|
||||
"title": "The Last of Us 2x3",
|
||||
},
|
||||
"sourceId": "soaper_de",
|
||||
"ttl": 900000,
|
||||
"url": "https://soaper.live/home/index/TVM3U8?key=LrezaYpLOxT4O61m8e3mSLdBzLNyRaf8zPmERxvwh1Mrj6zbVEUvAzRv2KZLu5PVvRKqwbcz6qmb9vbOi3wQZ4ae8RsZ9N3Jm9Yatw4yE55bBp.m3u8",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
|
|
|||
|
|
@ -18,5 +18,5 @@ export const guessFromPlaylist = async (ctx: Context, fetcher: Fetcher, url: URL
|
|||
.filter(height => height !== undefined)
|
||||
.map(height => parseInt(height));
|
||||
|
||||
return Math.max(...heights);
|
||||
return heights.length ? Math.max(...heights) : undefined;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue