mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 12:43:25 +00:00
proxied fetcher
This commit is contained in:
@@ -25,7 +25,7 @@ export const ridooScraper = makeEmbed({
|
|||||||
return (script.attr('type') === 'text/javascript' && script.html()?.includes('eval')) ?? false;
|
return (script.attr('type') === 'text/javascript' && script.html()?.includes('eval')) ?? false;
|
||||||
})
|
})
|
||||||
.html();
|
.html();
|
||||||
if (!evalCode) throw new Error(res);
|
if (!evalCode) throw new Error("Couldn't find eval code");
|
||||||
const decoded = unpack(evalCode);
|
const decoded = unpack(evalCode);
|
||||||
const regexPattern = /file:"([^"]+)"/g;
|
const regexPattern = /file:"([^"]+)"/g;
|
||||||
const url = regexPattern.exec(decoded)?.[1];
|
const url = regexPattern.exec(decoded)?.[1];
|
||||||
|
@@ -13,7 +13,7 @@ const ridoMoviesBase = `https://ridomovies.tv`;
|
|||||||
const ridoMoviesApiBase = `${ridoMoviesBase}/core/api`;
|
const ridoMoviesApiBase = `${ridoMoviesBase}/core/api`;
|
||||||
|
|
||||||
const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => {
|
const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => {
|
||||||
const searchResult = await ctx.fetcher<SearchResult>('/search', {
|
const searchResult = await ctx.proxiedFetcher<SearchResult>('/search', {
|
||||||
baseUrl: ridoMoviesApiBase,
|
baseUrl: ridoMoviesApiBase,
|
||||||
query: {
|
query: {
|
||||||
q: encodeURIComponent(ctx.media.title),
|
q: encodeURIComponent(ctx.media.title),
|
||||||
@@ -24,7 +24,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
|||||||
let iframeSourceUrl = `/${show.fullSlug}/videos`;
|
let iframeSourceUrl = `/${show.fullSlug}/videos`;
|
||||||
|
|
||||||
if (ctx.media.type === 'show') {
|
if (ctx.media.type === 'show') {
|
||||||
const showPageResult = await ctx.fetcher<string>(`/${show.fullSlug}`, {
|
const showPageResult = await ctx.proxiedFetcher<string>(`/${show.fullSlug}`, {
|
||||||
baseUrl: ridoMoviesBase,
|
baseUrl: ridoMoviesBase,
|
||||||
});
|
});
|
||||||
const fullEpisodeSlug = `${show.fullSlug}/season-${ctx.media.season.number}/episode-${ctx.media.episode.number}`;
|
const fullEpisodeSlug = `${show.fullSlug}/season-${ctx.media.season.number}/episode-${ctx.media.episode.number}`;
|
||||||
@@ -39,7 +39,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
|||||||
iframeSourceUrl = `/episodes/${episodeId}/videos`;
|
iframeSourceUrl = `/episodes/${episodeId}/videos`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const iframeSource = await ctx.fetcher<IframeSourceResult>(iframeSourceUrl, {
|
const iframeSource = await ctx.proxiedFetcher<IframeSourceResult>(iframeSourceUrl, {
|
||||||
baseUrl: ridoMoviesApiBase,
|
baseUrl: ridoMoviesApiBase,
|
||||||
});
|
});
|
||||||
const iframeSource$ = load(iframeSource.data[0].url);
|
const iframeSource$ = load(iframeSource.data[0].url);
|
||||||
|
Reference in New Issue
Block a user