mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:33:25 +00:00
Fixed vidplay subtitle oversight and refactored filemoon url to use vidplay's subtitles
This commit is contained in:
@@ -45,15 +45,9 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr
|
|||||||
embedArr.push({ source: source.title, url: decryptedUrl });
|
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) {
|
for (const embedObj of embedArr) {
|
||||||
if (embedObj.source === 'Vidplay') {
|
if (embedObj.source === 'Vidplay') {
|
||||||
const fullUrl = new URL(embedObj.url);
|
const fullUrl = new URL(embedObj.url);
|
||||||
if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl);
|
|
||||||
embeds.push({
|
embeds.push({
|
||||||
embedId: 'vidplay',
|
embedId: 'vidplay',
|
||||||
url: fullUrl.toString(),
|
url: fullUrl.toString(),
|
||||||
@@ -62,6 +56,9 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr
|
|||||||
|
|
||||||
if (embedObj.source === 'Filemoon') {
|
if (embedObj.source === 'Filemoon') {
|
||||||
const fullUrl = new URL(embedObj.url);
|
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);
|
if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl);
|
||||||
embeds.push({
|
embeds.push({
|
||||||
embedId: 'filemoon',
|
embedId: 'filemoon',
|
||||||
|
Reference in New Issue
Block a user