Merge pull request #86 from movie-web/fix/vidsrcto-without-subtitles

Fixed VidSrcTo crashing if no subtitles are found
This commit is contained in:
mrjvs
2024-01-30 20:51:05 +01:00
committed by GitHub

View File

@@ -46,7 +46,10 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr
} }
// Originally Filemoon does not have subtitles. But we can use the ones from Vidplay. // Originally Filemoon does not have subtitles. But we can use the ones from Vidplay.
const subtitleUrl = new URL(embedUrls.find((v) => v.includes('sub.info')) ?? '').searchParams.get('sub.info'); const urlWithSubtitles = embedUrls.find((v) => v.includes('sub.info'));
let subtitleUrl: string | null = null;
if (urlWithSubtitles) subtitleUrl = new URL(urlWithSubtitles).searchParams.get('sub.info');
for (const source of sources.result) { for (const source of sources.result) {
if (source.title === 'Vidplay') { if (source.title === 'Vidplay') {
const embedUrl = embedUrls.find((v) => v.includes('vidplay')); const embedUrl = embedUrls.find((v) => v.includes('vidplay'));