Update TurboVidPlay.ts
Last fix.
This commit is contained in:
parent
724740383d
commit
dc91c51e8b
1 changed files with 7 additions and 4 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue