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 @@ + +
+ +