From d1da91e03036e06581e258a0366e7f9a15803bb8 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Thu, 12 Jun 2025 12:06:15 +0000 Subject: [PATCH] fix(extractor): detect SuperVideo video deletion/expiration --- src/extractor/SuperVideo.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/extractor/SuperVideo.ts b/src/extractor/SuperVideo.ts index 38b4fb0..811e969 100644 --- a/src/extractor/SuperVideo.ts +++ b/src/extractor/SuperVideo.ts @@ -3,6 +3,7 @@ import * as cheerio from 'cheerio'; import { Extractor } from './types'; import { extractUrlFromPacked, Fetcher } from '../utils'; import { Context, Meta, UrlResult } from '../types'; +import { NotFoundError } from '../error'; export class SuperVideo implements Extractor { readonly id = 'supervideo'; @@ -28,6 +29,11 @@ export class SuperVideo implements Extractor { return await this.extract(ctx, new URL(`/e${url.pathname}`, url.origin), meta); } + /* istanbul ignore next TODO: Add test after refactoring. E.g. https://supervideo.cc/ndf5shmy9lpt */ + if (/'The file was deleted|The file expired/.test(html)) { + throw new NotFoundError(); + } + const heightAndSizeMatch = html.match(/\d{3,}x(\d{3,}), ([\d.]+ ?[GM]B)/); const $ = cheerio.load(html);