fix(handler): avoid creating invalid URLs in KinoGer
This commit is contained in:
parent
19395f1921
commit
9797957778
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue