chore(extractor): support caching via MediaFlow Proxy
This commit is contained in:
parent
33ee150915
commit
c556d9500b
15 changed files with 11 additions and 67 deletions
|
|
@ -22,7 +22,9 @@ export class ExtractorRegistry {
|
|||
}
|
||||
|
||||
const normalizedUrl = extractor.normalize(url);
|
||||
const cacheKey = `${extractor.id}_${normalizedUrl}`;
|
||||
const cacheKey = extractor.viaMediaFlowProxy
|
||||
? `${extractor.id}_${normalizedUrl}_${ctx.config.mediaFlowProxyUrl}`
|
||||
: `${extractor.id}_${normalizedUrl}`;
|
||||
|
||||
let urlResults = this.urlResultCache.get(cacheKey) ?? [];
|
||||
if (this.urlResultCache.has(cacheKey)) {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ export class Fastream extends Extractor {
|
|||
|
||||
public readonly label = 'Fastream (via MediaFlow Proxy)';
|
||||
|
||||
public override readonly ttl = 0;
|
||||
|
||||
public override viaMediaFlowProxy = true;
|
||||
|
||||
public supports(ctx: Context, url: URL): boolean {
|
||||
|
|
|
|||
|
|
@ -15,10 +15,6 @@ describe('Mixdrop', () => {
|
|||
expect(await extractorRegistry.handle(ctx, new URL('https://mixdrop.my/e/knq0kj8waq44l8'), CountryCode.de)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('mixdrop.my /f/', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://mixdrop.my/f/knq0kj8waq44l8'), CountryCode.de)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('deleted or expired file', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://mixdrop.ag/e/123456789'), CountryCode.de)).toMatchSnapshot();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ export class Mixdrop extends Extractor {
|
|||
|
||||
public readonly label = 'Mixdrop (via MediaFlow Proxy)';
|
||||
|
||||
public override readonly ttl = 0;
|
||||
|
||||
public override viaMediaFlowProxy = true;
|
||||
|
||||
public supports(ctx: Context, url: URL): boolean {
|
||||
|
|
|
|||
|
|
@ -12,10 +12,6 @@ export class Streamtape extends Extractor {
|
|||
|
||||
public readonly label = 'Streamtape (via MediaFlow Proxy)';
|
||||
|
||||
public override readonly ttl = 0;
|
||||
|
||||
public override viaMediaFlowProxy = true;
|
||||
|
||||
public supports(ctx: Context, url: URL): boolean {
|
||||
return null !== url.host.match(/streamtape/) && supportsMediaFlowProxy(ctx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,4 @@ describe('Uqload', () => {
|
|||
test('uqload.net /embed-', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://uqload.net/embed-z0xbr87oz637.html'), CountryCode.fr)).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('uqload.net /', async () => {
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://uqload.net/z0xbr87oz637.html'), CountryCode.fr)).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ export class Uqload extends Extractor {
|
|||
|
||||
public readonly label = 'Uqload (via MediaFlow Proxy)';
|
||||
|
||||
public override readonly ttl = 0;
|
||||
|
||||
public override viaMediaFlowProxy = true;
|
||||
|
||||
public supports(ctx: Context, url: URL): boolean {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ describe('VixSrc', () => {
|
|||
});
|
||||
|
||||
test('Black Mirror is excluded if no matching language was found', async () => {
|
||||
const ctx = createTestContext({ mediaFlowProxyUrl: 'https://mediaflow-proxy.test', mediaFlowProxyPassword: 'asdfg', de: 'on' });
|
||||
const ctx = createTestContext({ mediaFlowProxyUrl: 'https://mediaflow-proxy2.test', mediaFlowProxyPassword: 'asdfg', de: 'on' });
|
||||
|
||||
expect(await extractorRegistry.handle(ctx, new URL('https://vixsrc.to/tv/42009/4/2'), CountryCode.it, 'Black Mirror 4x2')).toMatchSnapshot();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@ export class VixSrc extends Extractor {
|
|||
|
||||
public readonly label = 'VixSrc (via MediaFlow Proxy)';
|
||||
|
||||
public override readonly ttl = 0;
|
||||
|
||||
public override viaMediaFlowProxy = true;
|
||||
|
||||
public supports(ctx: Context, url: URL): boolean {
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
{"destination_url":"https://vixsrc.to/playlist/307316?token=2f5004a3b15f4ccdb3446f2b132a0957&expires=1755949828&h=1","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://vixsrc.to/tv/42009/4/2"},"mediaflow_proxy_url":"https://mediaflow-proxy.test/proxy/hls/manifest.m3u8","query_params":{"api_password":"asdfg"}}
|
||||
|
|
@ -14,7 +14,7 @@ exports[`Fastream fastream.to embed 1`] = `
|
|||
"title": "black.mirror.s01e01.lat.720p.mp4",
|
||||
},
|
||||
"sourceId": "fastream_es",
|
||||
"ttl": 0,
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow-proxy.test/proxy/hls/manifest.m3u8?api_password=asdfg&h_user-agent=Mozilla%2F5.0+%28X11%3B+Linux+x86_64%3B+rv%3A138.0%29+Gecko%2F20100101+Firefox%2F138.0&h_Accept=*%2F*&h_Connection=keep-alive&h_Accept-Language=en-US%2Cen%3Bq%3D0.5&h_referer=https%3A%2F%2Ffastream.to%2F&h_origin=https%3A%2F%2Ffastream.to&d=https%3A%2F%2Fs28.fastream.to%2Fhls2%2F09%2F00024%2F3aooif4ozt10_%2Cl%2Cn%2Ch%2Cx%2C.urlset%2Fmaster.m3u8%3Ft%3Dnw6_aeN6pDROuXsJQwyrJVm3qHKFedVfbTNj5LgXH-4%26s%3D1752863379%26e%3D43200%26v%3D1058373%26i%3D0.3%26sp%3D0",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,26 +15,7 @@ exports[`Mixdrop mixdrop.my /e/ 1`] = `
|
|||
"title": "28_giorni_dopo_2002_HD_-_Altadefinizione01.mp4",
|
||||
},
|
||||
"sourceId": "mixdrop_de",
|
||||
"ttl": 0,
|
||||
"url": "https://mediaflow-proxy.test/extractor/video?host=Mixdrop&api_password=asdfg&d=https%3A%2F%2Fmixdrop.my%2Fe%2Fknq0kj8waq44l8&redirect_stream=true",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Mixdrop mixdrop.my /f/ 1`] = `
|
||||
[
|
||||
{
|
||||
"format": "mp4",
|
||||
"label": "Mixdrop (via MediaFlow Proxy)",
|
||||
"meta": {
|
||||
"bytes": 1059806248,
|
||||
"countryCodes": [
|
||||
"de",
|
||||
],
|
||||
"title": "28_giorni_dopo_2002_HD_-_Altadefinizione01.mp4",
|
||||
},
|
||||
"sourceId": "mixdrop_de",
|
||||
"ttl": 0,
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow-proxy.test/extractor/video?host=Mixdrop&api_password=asdfg&d=https%3A%2F%2Fmixdrop.my%2Fe%2Fknq0kj8waq44l8&redirect_stream=true",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ exports[`Streamtape streamtape.com /e 1`] = `
|
|||
"title": "mickey-17-2025-[latino].mp4",
|
||||
},
|
||||
"sourceId": "streamtape_es",
|
||||
"ttl": 0,
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow.test.org/extractor/video?host=Streamtape&api_password=test&d=https%3A%2F%2Fstreamtape.com%2Fe%2F84Kb3mkoYAiokmW&redirect_stream=true",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,25 +1,5 @@
|
|||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`Uqload uqload.net / 1`] = `
|
||||
[
|
||||
{
|
||||
"format": "mp4",
|
||||
"label": "Uqload (via MediaFlow Proxy)",
|
||||
"meta": {
|
||||
"bytes": 431690639,
|
||||
"countryCodes": [
|
||||
"fr",
|
||||
],
|
||||
"height": 360,
|
||||
"title": "Black Mirror S07E06 MULTI VFF 1080p WEBrip EAC3 5 1 x265-TyHD",
|
||||
},
|
||||
"sourceId": "uqload_fr",
|
||||
"ttl": 0,
|
||||
"url": "https://mediaflow.test.org/extractor/video?host=Uqload&api_password=test&d=https%3A%2F%2Fuqload.net%2Fz0xbr87oz637.html&redirect_stream=true",
|
||||
},
|
||||
]
|
||||
`;
|
||||
|
||||
exports[`Uqload uqload.net /embed- 1`] = `
|
||||
[
|
||||
{
|
||||
|
|
@ -34,7 +14,7 @@ exports[`Uqload uqload.net /embed- 1`] = `
|
|||
"title": "Black Mirror S07E06 MULTI VFF 1080p WEBrip EAC3 5 1 x265-TyHD",
|
||||
},
|
||||
"sourceId": "uqload_fr",
|
||||
"ttl": 0,
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow.test.org/extractor/video?host=Uqload&api_password=test&d=https%3A%2F%2Fuqload.net%2Fz0xbr87oz637.html&redirect_stream=true",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ exports[`VixSrc Black Mirror 1`] = `
|
|||
"title": "Black.Mirror.S04E02.Arkangel.1080p.NF.WEB-DL.ITA.ENG.DDP5.1.H.264.mkv",
|
||||
},
|
||||
"sourceId": "vixsrc_it",
|
||||
"ttl": 0,
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow-proxy.test/proxy/hls/manifest.m3u8?api_password=asdfg&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%2Fvixsrc.to%2Ftv%2F42009%2F4%2F2&d=https%3A%2F%2Fvixsrc.to%2Fplaylist%2F307316%3Ftoken%3D2f5004a3b15f4ccdb3446f2b132a0957%26expires%3D1755949828%26h%3D1",
|
||||
},
|
||||
]
|
||||
|
|
@ -38,7 +38,7 @@ exports[`VixSrc Full Metal Jacket 1`] = `
|
|||
"title": "Full.metal.jacket.1987.1080p.x264.AC3.ITA.AAC.ENG.Subs.mkv",
|
||||
},
|
||||
"sourceId": "vixsrc_it",
|
||||
"ttl": 0,
|
||||
"ttl": 900000,
|
||||
"url": "https://mediaflow-proxy.test/proxy/hls/manifest.m3u8?api_password=asdfg&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%2Fvixsrc.to%2Fmovie%2F600&d=https%3A%2F%2Fvixsrc.to%2Fplaylist%2F219736%3Ftoken%3D689cf5587c2fec67fd83503a2a7dfd64%26expires%3D1755949827%26h%3D1",
|
||||
},
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue