perf(extractor): do not guess resolution via MFP playlist for Voe

This commit is contained in:
WebStreamr 2025-10-07 13:47:56 +00:00
parent b3db546e00
commit 8fb3320868
No known key found for this signature in database
12 changed files with 1929 additions and 287 deletions

View file

@ -14,6 +14,10 @@ describe('Voe', () => {
expect(await extractorRegistry.handle(ctx, new URL('https://jilliandescribecompany.com/e/ea21l02gcygw'))).toMatchSnapshot();
});
test('premium only without resolution', async () => {
expect(await extractorRegistry.handle(ctx, new URL('https://jilliandescribecompany.com/qqfyi04w52mj'))).toMatchSnapshot();
});
test('encoding error', async () => {
expect(await extractorRegistry.handle(ctx, new URL('https://voe.sx/e/c2yxvit4f6bz'))).toMatchSnapshot();
});

View file

@ -1,10 +1,9 @@
import bytes from 'bytes';
import * as cheerio from 'cheerio';
import { NotFoundError } from '../error';
import { Context, Format, Meta, UrlResult } from '../types';
import {
buildMediaFlowProxyExtractorStreamUrl,
guessHeightFromPlaylist,
MEDIAFLOW_DEFAULT_INIT,
supportsMediaFlowProxy,
} from '../utils';
import { Extractor } from './Extractor';
@ -114,9 +113,7 @@ export class Voe extends Extractor {
}
public override normalize(url: URL): URL {
const videoId = url.pathname.split('/').slice(-1)[0] as string;
return new URL(`/e/${videoId}`, url);
return new URL(`/${url.pathname.split('/').slice(-1)[0]}`, url);
}
protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise<UrlResult[]> {
@ -136,6 +133,9 @@ export class Voe extends Extractor {
const $ = cheerio.load(html);
const title = $('meta[name="description"]').attr('content')?.trim().replace(/^Watch /, '').replace(/ at VOE$/, '').trim();
const sizeMatch = html.matchAll(/[\d.]+ ?[GM]B/g).toArray().at(-1);
const heightMatch = html.match(/<b>(\d{3,})p<\/b>/);
const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'Voe', url, headers);
return [
@ -147,8 +147,9 @@ export class Voe extends Extractor {
ttl: this.ttl,
meta: {
...meta,
height: await guessHeightFromPlaylist(ctx, this.fetcher, playlistUrl, MEDIAFLOW_DEFAULT_INIT),
title,
...(sizeMatch && { bytes: bytes.parse(sizeMatch[0] as string) as number }),
...(heightMatch && { height: parseInt(heightMatch[1] as string) }),
},
},
];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,4 +0,0 @@
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1186371,RESOLUTION=1368x720,FRAME-RATE=24.000,CODECS="avc1.640020,mp4a.40.2",VIDEO-RANGE=PQ
https://mediaflow.test.org/proxy/hls/manifest.m3u8?api_password=test&h_user-agent=Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F136.0.0.0+Safari%2F537.36&h_referer=https%3A%2F%2Fjilliandescribecompany.com%2Fe%2Fea21l02gcygw&d=https%3A%2F%2Fcdn-kuc3ehpz4wnczfyz.orbitcache.com%2Fengine%2Fhls2-c%2F01%2F15242%2Fea21l02gcygw_%2Cn%2C.urlset%2Findex-v1-a1.m3u8%3Ft%3D3iMAKoJqij6nC4HDamYxtDB75a_-AlG_wD1demRBo0I%26s%3D1759754183%26e%3D14400%26f%3D76213694%26node%3DFPYruvgfgORaUYuYfpByMgjFbC8X%2FHWKW1utbUQQRyQ%3D%26i%3D104.28%26sp%3D2500%26asn%3D13335%26q%3Dn%26rq%3DzKNpONzQJHzTeXTzr0V2M9V4DUnzwX9C8hTNxrUW
#EXT-X-I-FRAME-STREAM-INF:BANDWIDTH=25403,RESOLUTION=1368x720,CODECS="avc1.640020",URI="https://mediaflow.test.org/proxy/hls/manifest.m3u8?api_password=test&h_user-agent=Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F136.0.0.0+Safari%2F537.36&h_referer=https%3A%2F%2Fjilliandescribecompany.com%2Fe%2Fea21l02gcygw&d=https%3A%2F%2Fcdn-kuc3ehpz4wnczfyz.orbitcache.com%2Fengine%2Fhls2-c%2F01%2F15242%2Fea21l02gcygw_%2Cn%2C.urlset%2Fiframes-v1-a1.m3u8%3Ft%3D3iMAKoJqij6nC4HDamYxtDB75a_-AlG_wD1demRBo0I%26s%3D1759754183%26e%3D14400%26f%3D76213694%26node%3DFPYruvgfgORaUYuYfpByMgjFbC8X%2FHWKW1utbUQQRyQ%3D%26i%3D104.28%26sp%3D2500%26asn%3D13335%26q%3Dn%26rq%3DzKNpONzQJHzTeXTzr0V2M9V4DUnzwX9C8hTNxrUW",VIDEO-RANGE=PQ

View file

@ -0,0 +1 @@
{"destination_url":"https://cdn-thhhlmzuxvpehc9r.orbitcache.com/engine/hls2-c/01/11526/qqfyi04w52mj_,l,.urlset/master.m3u8?t=g2zuS_OAHTtjrVe0bHp2xYcX7PpDxg8ebRIHTmF3H1c&s=1759861731&e=14400&f=57634053&node=UOx5276IumOH4BADikx4rlHC+ibdAWZ+mo07sx3WfaU=&i=104.28&sp=2500&asn=13335&q=l&rq=FxkyWdISXylA0UaLSPNcXWkDrksjs0pkAzy0GvIS","request_headers":{"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","referer":"https://jilliandescribecompany.com/qqfyi04w52mj"},"mediaflow_proxy_url":"https://mediaflow.test.org/proxy/hls/manifest.m3u8","query_params":{"api_password":"test"}}

View file

@ -13,10 +13,10 @@
currentUrl.searchParams.set('permanentToken', permanentToken);
window.location.href = currentUrl.toString();
} else {
window.location.href = 'https://jilliandescribecompany.com/e/c2yxvit4f6bz';
window.location.href = 'https://jilliandescribecompany.com/c2yxvit4f6bz';
}
} else {
window.location.href = 'https://jilliandescribecompany.com/e/c2yxvit4f6bz';
window.location.href = 'https://jilliandescribecompany.com/c2yxvit4f6bz';
}
</script>
</body>

View file

@ -8,6 +8,7 @@ exports[`Voe jilliandescribecompany 1`] = `
"format": "hls",
"label": "VOE (via MediaFlow Proxy)",
"meta": {
"bytes": 1202590842,
"countryCodes": [],
"height": 720,
"title": "Superman.2025.2160p.WEB-DL.DV.HDR10Plus.X265.DDP5.1.Atmos-YIN.mp4",
@ -18,3 +19,20 @@ exports[`Voe jilliandescribecompany 1`] = `
},
]
`;
exports[`Voe premium only without resolution 1`] = `
[
{
"format": "hls",
"label": "VOE (via MediaFlow Proxy)",
"meta": {
"bytes": 363216240,
"countryCodes": [],
"title": "268836--21ba9fb2-97f9-4566-b5eb-3d9cef7674cf--zrxn--2352322-voesx.mp4",
},
"sourceId": "voe_",
"ttl": 900000,
"url": "https://mediaflow.test.org/proxy/hls/manifest.m3u8?api_password=test&h_user-agent=Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F136.0.0.0+Safari%2F537.36&h_referer=https%3A%2F%2Fjilliandescribecompany.com%2Fqqfyi04w52mj&d=https%3A%2F%2Fcdn-thhhlmzuxvpehc9r.orbitcache.com%2Fengine%2Fhls2-c%2F01%2F11526%2Fqqfyi04w52mj_%2Cl%2C.urlset%2Fmaster.m3u8%3Ft%3Dg2zuS_OAHTtjrVe0bHp2xYcX7PpDxg8ebRIHTmF3H1c%26s%3D1759861731%26e%3D14400%26f%3D57634053%26node%3DUOx5276IumOH4BADikx4rlHC%2BibdAWZ%2Bmo07sx3WfaU%3D%26i%3D104.28%26sp%3D2500%26asn%3D13335%26q%3Dl%26rq%3DFxkyWdISXylA0UaLSPNcXWkDrksjs0pkAzy0GvIS",
},
]
`;