diff --git a/src/providers/sources/vidsrcto/index.ts b/src/providers/sources/vidsrcto/index.ts index b85b068..6912ae1 100644 --- a/src/providers/sources/vidsrcto/index.ts +++ b/src/providers/sources/vidsrcto/index.ts @@ -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. - 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) { if (source.title === 'Vidplay') { const embedUrl = embedUrls.find((v) => v.includes('vidplay'));