diff --git a/src/extractor/Fsst.test.ts b/src/extractor/Fsst.test.ts index ae7122a..2b5b9c8 100644 --- a/src/extractor/Fsst.test.ts +++ b/src/extractor/Fsst.test.ts @@ -17,4 +17,8 @@ describe('Fsst', () => { test('Dead City', async () => { expect(await extractorRegistry.handle(ctx, new URL('https://fsst.online/embed/901994/'), CountryCode.de)).toMatchSnapshot(); }); + + test('How to Train Your Dragon', async () => { + expect(await extractorRegistry.handle(ctx, new URL('https://fsst.online/embed/902668/'), CountryCode.de)).toMatchSnapshot(); + }); }); diff --git a/src/extractor/Fsst.ts b/src/extractor/Fsst.ts index bc328d0..01b3320 100644 --- a/src/extractor/Fsst.ts +++ b/src/extractor/Fsst.ts @@ -29,15 +29,17 @@ export class Fsst extends Extractor { const filesMatch = html.match(/file:"(.*)"/) as string[]; return (filesMatch[1] as string).split(',').map((fileString, index) => { - const heightAndUrlMatch = fileString.match(/\[([\d]+)p\](.*)/) as string[]; + const heightAndUrlMatch = fileString.match(/\[?([\d]*)p?]?(.*)/) as string[]; + const fileHref = heightAndUrlMatch[2] as string; + const heightFromFileHrefMatch = fileHref.match(/([\d]+)p/) as string[]; return { - url: new URL(heightAndUrlMatch[2] as string), + url: new URL(fileHref), label: this.label, sourceId: `${this.id}_${countryCode}_${index}`, meta: { countryCode, - height: parseInt(heightAndUrlMatch[1] as string), + height: parseInt(heightAndUrlMatch[1] || heightFromFileHrefMatch[1] as string), title, }, }; diff --git a/src/extractor/__fixtures__/Fsst/https:fsst.onlineembed902668 b/src/extractor/__fixtures__/Fsst/https:fsst.onlineembed902668 new file mode 100644 index 0000000..48465d0 --- /dev/null +++ b/src/extractor/__fixtures__/Fsst/https:fsst.onlineembed902668 @@ -0,0 +1,199 @@ + + + + How To Train Your Dragon 2025.mp4 + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/extractor/__snapshots__/Fsst.test.ts.snap b/src/extractor/__snapshots__/Fsst.test.ts.snap index b11756b..6c6c174 100644 --- a/src/extractor/__snapshots__/Fsst.test.ts.snap +++ b/src/extractor/__snapshots__/Fsst.test.ts.snap @@ -69,3 +69,18 @@ exports[`Fsst Dead City 1`] = ` }, ] `; + +exports[`Fsst How to Train Your Dragon 1`] = ` +[ + { + "label": "Fsst", + "meta": { + "countryCode": "de", + "height": 360, + "title": "How To Train Your Dragon 2025.mp4", + }, + "sourceId": "fsst_de_0", + "url": "https://www.secvideo1.online/get_file/10/648fc9b266670e9ad6756a066a68a8db0b36868457/902000/902668/902668_360p.mp4/", + }, +] +`;