diff --git a/src/extractor/Fastream.test.ts b/src/extractor/Fastream.test.ts index c708747..a3da9a9 100644 --- a/src/extractor/Fastream.test.ts +++ b/src/extractor/Fastream.test.ts @@ -13,4 +13,8 @@ describe('Fastream', () => { test('fastream.to embed', async () => { expect(await extractorRegistry.handle(ctx, new URL('https://fastream.to/embed-3aooif4ozt10.html'))).toMatchSnapshot(); }); + + test('expired or deleted', async () => { + expect(await extractorRegistry.handle(ctx, new URL('https://fastream.to/embed-a9rp1d1pqom7.html'))).toMatchSnapshot(); + }); }); diff --git a/src/extractor/Fastream.ts b/src/extractor/Fastream.ts index 0fe226e..a2e5e9c 100644 --- a/src/extractor/Fastream.ts +++ b/src/extractor/Fastream.ts @@ -1,4 +1,5 @@ import bytes from 'bytes'; +import { NotFoundError } from '../error'; import { Context, Format, Meta, UrlResult } from '../types'; import { buildMediaFlowProxyExtractorStreamUrl, supportsMediaFlowProxy } from '../utils'; import { Extractor } from './Extractor'; @@ -21,11 +22,15 @@ export class Fastream extends Extractor { protected async extractInternal(ctx: Context, url: URL, meta: Meta): Promise { const headers = { Referer: meta.referer ?? url.href }; - const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'Fastream', url, headers); - const downloadUrl = new URL(url.href.replace('/embed-', '/d/')); const html = await this.fetcher.text(ctx, downloadUrl, { headers }); + if (/No such file/.test(html)) { + throw new NotFoundError(); + } + + const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'Fastream', url, headers); + const heightAndSizeMatch = html.match(/\d{3,}x(\d{3,}), ([\d.]+ ?[GM]B)/) as string[]; const titleMatch = html.match(/>Download (.*?) + + + + Fastream + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+ + +
+ + Sign Up +
+
+ +
+ + +
+
+
+ + + + +
+ +
+ + + + +
+ + +
+ + + + + + +
+ + + diff --git a/src/extractor/__snapshots__/Fastream.test.ts.snap b/src/extractor/__snapshots__/Fastream.test.ts.snap index 9d23f6b..a3baf48 100644 --- a/src/extractor/__snapshots__/Fastream.test.ts.snap +++ b/src/extractor/__snapshots__/Fastream.test.ts.snap @@ -1,5 +1,7 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing +exports[`Fastream expired or deleted 1`] = `[]`; + exports[`Fastream fastream.to embed 1`] = ` [ {