fix(extractor): handle SaveFiles /d/ links properly
This commit is contained in:
parent
05d11e366b
commit
eecd3255f0
5 changed files with 3340 additions and 1 deletions
|
|
@ -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();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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[]> {
|
||||
|
|
|
|||
1643
src/extractor/__fixtures__/SaveFiles/https:savefiles.comedptfmhyjr39
generated
Normal file
1643
src/extractor/__fixtures__/SaveFiles/https:savefiles.comedptfmhyjr39
generated
Normal file
File diff suppressed because one or more lines are too long
1650
src/extractor/__fixtures__/SaveFiles/https:savefiles.coms9g6zb5kjbqd
generated
Normal file
1650
src/extractor/__fixtures__/SaveFiles/https:savefiles.coms9g6zb5kjbqd
generated
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -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`] = `
|
||||
[
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue