mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:43:26 +00:00
fix ranks and feedback
This commit is contained in:
@@ -12,7 +12,7 @@ const referer = 'https://ridomovies.tv/';
|
||||
export const closeLoadScraper = makeEmbed({
|
||||
id: 'closeload',
|
||||
name: 'CloseLoad',
|
||||
rank: 501,
|
||||
rank: 106,
|
||||
async scrape(ctx) {
|
||||
const baseUrl = new URL(ctx.url).origin;
|
||||
|
||||
|
@@ -1,6 +1,3 @@
|
||||
import { load } from 'cheerio';
|
||||
import { unpack } from 'unpacker';
|
||||
|
||||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
@@ -11,24 +8,15 @@ const referer = 'https://ridomovies.tv/';
|
||||
export const ridooScraper = makeEmbed({
|
||||
id: 'ridoo',
|
||||
name: 'Ridoo',
|
||||
rank: 500,
|
||||
rank: 105,
|
||||
async scrape(ctx) {
|
||||
const res = await ctx.proxiedFetcher<string>(ctx.url, {
|
||||
headers: {
|
||||
referer,
|
||||
},
|
||||
});
|
||||
const $ = load(res);
|
||||
const evalCode = $('script')
|
||||
.filter((_, el) => {
|
||||
const script = $(el);
|
||||
return (script.attr('type') === 'text/javascript' && script.html()?.includes('eval')) ?? false;
|
||||
})
|
||||
.html();
|
||||
if (!evalCode) throw new Error("Couldn't find eval code");
|
||||
const decoded = unpack(evalCode);
|
||||
const regexPattern = /file:"([^"]+)"/g;
|
||||
const url = regexPattern.exec(decoded)?.[1];
|
||||
const url = regexPattern.exec(res)?.[1];
|
||||
if (!url) throw new NotFoundError('Unable to find source url');
|
||||
|
||||
return {
|
||||
|
@@ -16,10 +16,11 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
||||
const searchResult = await ctx.proxiedFetcher<SearchResult>('/search', {
|
||||
baseUrl: ridoMoviesApiBase,
|
||||
query: {
|
||||
q: encodeURIComponent(ctx.media.title),
|
||||
q: ctx.media.title,
|
||||
},
|
||||
});
|
||||
const show = searchResult.data.items[0];
|
||||
if (!show) throw new NotFoundError('No watchable item found');
|
||||
|
||||
let iframeSourceUrl = `/${show.fullSlug}/videos`;
|
||||
|
||||
@@ -67,7 +68,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
||||
export const ridooMoviesScraper = makeSourcerer({
|
||||
id: 'ridomovies',
|
||||
name: 'RidoMovies',
|
||||
rank: 500,
|
||||
rank: 105,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
scrapeMovie: universalScraper,
|
||||
scrapeShow: universalScraper,
|
||||
|
Reference in New Issue
Block a user