From 44686f76deb15aa5cd4915abe6b23e5322c98316 Mon Sep 17 00:00:00 2001 From: Paradox-77 Date: Fri, 15 Mar 2024 00:41:32 +0530 Subject: [PATCH] Fixed vidplay subtitle oversight and refactored filemoon url to use vidplay's subtitles --- src/providers/sources/vidsrcto/index.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/providers/sources/vidsrcto/index.ts b/src/providers/sources/vidsrcto/index.ts index fcc7197..b0b95f9 100644 --- a/src/providers/sources/vidsrcto/index.ts +++ b/src/providers/sources/vidsrcto/index.ts @@ -45,15 +45,9 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr embedArr.push({ source: source.title, url: decryptedUrl }); } - // Originally Filemoon does not have subtitles. But we can use the ones from Vidplay. - const urlWithSubtitles = embedArr.find((v) => v.url.includes('sub.info'))?.url; - let subtitleUrl: string | null = null; - if (urlWithSubtitles) subtitleUrl = new URL(urlWithSubtitles).searchParams.get('sub.info'); - for (const embedObj of embedArr) { if (embedObj.source === 'Vidplay') { const fullUrl = new URL(embedObj.url); - if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl); embeds.push({ embedId: 'vidplay', url: fullUrl.toString(), @@ -62,6 +56,9 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr if (embedObj.source === 'Filemoon') { const fullUrl = new URL(embedObj.url); + // Originally Filemoon does not have subtitles. But we can use the ones from Vidplay. + const urlWithSubtitles = embedArr.find((v) => v.source === 'Vidplay' && v.url.includes('sub.info'))?.url; + const subtitleUrl = urlWithSubtitles ? new URL(urlWithSubtitles).searchParams.get('sub.info') : null; if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl); embeds.push({ embedId: 'filemoon',