mirror of
https://github.com/p-stream/providers.git
synced 2026-05-17 13:12:11 +00:00
Update cuevana3.ts
This commit is contained in:
parent
4e0f256461
commit
ede4e872ad
1 changed files with 1 additions and 18 deletions
|
|
@ -89,16 +89,6 @@ async function extractVideos(ctx: MovieScrapeContext | ShowScrapeContext, videos
|
||||||
return videoList;
|
return videoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchTitleSubstitutes(): Promise<Record<string, string>> {
|
|
||||||
try {
|
|
||||||
const response = await fetch('https://raw.githubusercontent.com/moonpic/fixed-titles/refs/heads/main/main.json');
|
|
||||||
if (!response.ok) throw new Error('Failed to fetch fallback titles');
|
|
||||||
return await response.json();
|
|
||||||
} catch {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||||
const mediaType = ctx.media.type;
|
const mediaType = ctx.media.type;
|
||||||
const tmdbId = ctx.media.tmdbId;
|
const tmdbId = ctx.media.tmdbId;
|
||||||
|
|
@ -155,14 +145,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
|
||||||
}
|
}
|
||||||
|
|
||||||
if (embeds.length === 0) {
|
if (embeds.length === 0) {
|
||||||
const fallbacks = await fetchTitleSubstitutes();
|
normalizedTitle = normalizeTitle(ctx.media.title);
|
||||||
const fallbackTitle = fallbacks[tmdbId.toString()];
|
|
||||||
|
|
||||||
if (!fallbackTitle) {
|
|
||||||
throw new NotFoundError('No embed data found and no fallback title available');
|
|
||||||
}
|
|
||||||
|
|
||||||
normalizedTitle = normalizeTitle(fallbackTitle);
|
|
||||||
pageUrl =
|
pageUrl =
|
||||||
mediaType === 'movie'
|
mediaType === 'movie'
|
||||||
? `${baseUrl}/ver-pelicula/${normalizedTitle}`
|
? `${baseUrl}/ver-pelicula/${normalizedTitle}`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue