Update TurboVidPlay.ts

Last fix.
This commit is contained in:
GSTAR 2025-12-01 00:28:35 +01:00 committed by GitHub
parent 724740383d
commit dc91c51e8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,10 +51,13 @@ export class TurboVidPlay extends Extractor {
throw new NotFoundError(); throw new NotFoundError();
} }
const match = html.match(/(?:urlPlay|data-hash)\s*=\s*['"](?<url>[^"']+)/); // Extract media URL via named capture group
const match = html.match(
/(?:urlPlay|data-hash)\s*=\s*['"](?<url>[^"']+)/,
);
const mediaUrl const groups = match?.groups as Record<string, string> | undefined;
= match?.groups?.url; const mediaUrl = groups?.['url'];
if (!mediaUrl) { if (!mediaUrl) {
throw new NotFoundError('Video link not found'); throw new NotFoundError('Video link not found');
@ -98,7 +101,7 @@ export class TurboVidPlay extends Extractor {
} }
} }
} catch { } catch {
// intentionally ignored // Ignore playlist parsing errors
} }
const $ = cheerio.load(html); const $ = cheerio.load(html);