chore(extractor): normalize Mixdrop non-embed URLs

This commit is contained in:
WebStreamr 2025-07-16 10:56:51 +00:00
parent 45febec802
commit 7cf313cedb
No known key found for this signature in database
3 changed files with 26 additions and 0 deletions

View file

@ -15,6 +15,10 @@ 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();
});

View file

@ -26,6 +26,8 @@ export class Mixdrop extends Extractor {
return null !== url.host.match(/mixdrop/) && supportsMediaFlowProxy(ctx);
}
public override readonly normalize = (url: URL): URL => new URL(url.href.replace('/f/', '/e/'));
protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise<UrlResult[]> {
const fileUrl = new URL(url.href.replace('/e/', '/f/'));
const html = await this.fetcher.text(ctx, fileUrl);

View file

@ -21,3 +21,23 @@ exports[`Mixdrop mixdrop.my /e/ 1`] = `
},
]
`;
exports[`Mixdrop mixdrop.my /f/ 1`] = `
[
{
"format": "mp4",
"label": "Mixdrop (via MediaFlow Proxy)",
"meta": {
"bytes": 1059806248,
"countryCodes": [
"de",
],
"height": undefined,
"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",
},
]
`;