fix(handler): avoid creating invalid URLs in KinoGer

This commit is contained in:
WebStreamr 2025-06-11 08:23:58 +00:00
parent 19395f1921
commit 9797957778
No known key found for this signature in database

View file

@ -56,12 +56,12 @@ export class KinoGer implements Handler {
return;
}
const url = urlsMatch[1].split(',')[episodeIndex];
if (!url) {
const urlMatch = (urlsMatch[1].split(',')[episodeIndex] ?? '').match(/https?:\/\/[^\s'"<>]+/);
if (!urlMatch) {
return;
}
episodeUrl = new URL(url.replaceAll('[', '').replaceAll('\'', '').trim());
episodeUrl = new URL(urlMatch[0]);
});
return episodeUrl;