From 285996cbf6f8a8a92fd18cc365006fb980436d75 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Wed, 13 Aug 2025 20:34:07 +0000 Subject: [PATCH] fix(extractor): handle SaveFiles locked file --- src/extractor/SaveFiles.test.ts | 4 + src/extractor/SaveFiles.ts | 5 + .../SaveFiles/https:savefiles.comomqq55i59nvv | 1493 +++++++++++++++++ .../__snapshots__/SaveFiles.test.ts.snap | 2 + 4 files changed, 1504 insertions(+) create mode 100644 src/extractor/__fixtures__/SaveFiles/https:savefiles.comomqq55i59nvv diff --git a/src/extractor/SaveFiles.test.ts b/src/extractor/SaveFiles.test.ts index 3d2cd7d..52da638 100644 --- a/src/extractor/SaveFiles.test.ts +++ b/src/extractor/SaveFiles.test.ts @@ -15,6 +15,10 @@ describe('SafeFiles', () => { expect(await extractorRegistry.handle(ctx, new URL('https://savefiles.com/ip0k0dj2g0i3'), CountryCode.en)).toMatchSnapshot(); }); + test('savefiles locked file', async () => { + expect(await extractorRegistry.handle(ctx, new URL('https://savefiles.com/omqq55i59nvv'), CountryCode.en)).toMatchSnapshot(); + }); + test('streamhls /e/', async () => { expect(await extractorRegistry.handle(ctx, new URL('https://streamhls.to/e/ip0k0dj2g0i3'), CountryCode.en)).toMatchSnapshot(); }); diff --git a/src/extractor/SaveFiles.ts b/src/extractor/SaveFiles.ts index c18e555..3268fb7 100644 --- a/src/extractor/SaveFiles.ts +++ b/src/extractor/SaveFiles.ts @@ -1,4 +1,5 @@ import * as cheerio from 'cheerio'; +import { NotFoundError } from '../error'; import { Context, CountryCode, Format, UrlResult } from '../types'; import { Fetcher } from '../utils'; import { Extractor } from './Extractor'; @@ -27,6 +28,10 @@ export class SaveFiles extends Extractor { protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const html = await this.fetcher.text(ctx, url); + if (/File was locked by administrator/.test(html)) { + throw new NotFoundError(); + } + const fileMatch = html.match(/file:"(.*?)"/) as string[]; const sizeMatch = html.match(/\[\d{3,}x(\d{3,})/) as string[]; diff --git a/src/extractor/__fixtures__/SaveFiles/https:savefiles.comomqq55i59nvv b/src/extractor/__fixtures__/SaveFiles/https:savefiles.comomqq55i59nvv new file mode 100644 index 0000000..930a841 --- /dev/null +++ b/src/extractor/__fixtures__/SaveFiles/https:savefiles.comomqq55i59nvv @@ -0,0 +1,1493 @@ + + + + + + + + + + + + + Watch Jurassic World Rebirth 2025 1080p WEB DDP5 Atmos 264 This Movie IsDINOmite + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+
+ + +
File was locked by administrator
+ +
+
+ + + + +
+
+
+ + +
+
+
+

+ Jurassic World Rebirth 2025 1080p MA WEB-DL DDP5 1 Atmos H 264-ThisMovieIsDINOmite + +

+
+
+ on Aug 5, 2025 +
+ + +
+
+
+
+ +
+
+
+
+ + + + + + + + + + + +
+ +
+ +
+
+ + +
+
+
+
+ + +
+
+ +
+ +
+ + +
+
+ +
+
+ + + + + + + +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + \ No newline at end of file diff --git a/src/extractor/__snapshots__/SaveFiles.test.ts.snap b/src/extractor/__snapshots__/SaveFiles.test.ts.snap index 0823297..7ae6d9c 100644 --- a/src/extractor/__snapshots__/SaveFiles.test.ts.snap +++ b/src/extractor/__snapshots__/SaveFiles.test.ts.snap @@ -19,6 +19,8 @@ exports[`SafeFiles savefiles 1`] = ` ] `; +exports[`SafeFiles savefiles locked file 1`] = `[]`; + exports[`SafeFiles streamhls /e/ 1`] = ` [ {