fix(extractor): handle SaveFiles /d/ links properly

This commit is contained in:
WebStreamr 2025-08-21 10:20:52 +00:00
parent 05d11e366b
commit eecd3255f0
No known key found for this signature in database
5 changed files with 3340 additions and 1 deletions

View file

@ -15,6 +15,14 @@ describe('SafeFiles', () => {
expect(await extractorRegistry.handle(ctx, new URL('https://savefiles.com/ip0k0dj2g0i3'), CountryCode.en)).toMatchSnapshot();
});
test('savefiles /e/', async () => {
expect(await extractorRegistry.handle(ctx, new URL('https://savefiles.com/e/edptfmhyjr39'), CountryCode.en)).toMatchSnapshot();
});
test('savefiles /d/', async () => {
expect(await extractorRegistry.handle(ctx, new URL('https://savefiles.com/d/s9g6zb5kjbqd'), CountryCode.en)).toMatchSnapshot();
});
test('savefiles locked file', async () => {
expect(await extractorRegistry.handle(ctx, new URL('https://savefiles.com/omqq55i59nvv'), CountryCode.en)).toMatchSnapshot();
});

View file

@ -22,7 +22,7 @@ export class SaveFiles extends Extractor {
}
public override normalize(url: URL): URL {
return new URL(url.href.replace('/e/', '/'));
return new URL(url.href.replace('/e/', '/').replace('/d/', '/'));
}
protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise<UrlResult[]> {

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,5 +1,43 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`SafeFiles savefiles /d/ 1`] = `
[
{
"format": "hls",
"label": "SaveFiles",
"meta": {
"countryCodes": [
"en",
],
"height": 532,
"title": "dexter resurrection s01e01 1080p web h264-successfulcrab",
},
"sourceId": "savefiles_en",
"ttl": 900000,
"url": "https://s3.savefiles.com/hls2/01/00133/,c51qm3p0rhtm_n,.urlset/master.m3u8?t=ptFA7PhoGXdNqH2jfu3EVKT4Fn5laaqfHBW1MMOa74o&s=1755775635&e=43200&v=199331&srv=s1&i=0.0&sp=0",
},
]
`;
exports[`SafeFiles savefiles /e/ 1`] = `
[
{
"format": "hls",
"label": "SaveFiles",
"meta": {
"countryCodes": [
"en",
],
"height": 720,
"title": "dexter resurrection s01e01 1080p web h264-successfulcrab",
},
"sourceId": "savefiles_en",
"ttl": 900000,
"url": "https://s3.savefiles.com/hls2/01/00133/,j4orffalv89e_n,.urlset/master.m3u8?t=uwZgBnJBJ-wfgWvDwmLamHkR-vuqzrBFuLH7QoAH-QE&s=1755775635&e=43200&v=199330&srv=s1&i=0.0&sp=0",
},
]
`;
exports[`SafeFiles savefiles 1`] = `
[
{