mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
Changes requests by jvs
This commit is contained in:
@@ -1,37 +1,26 @@
|
|||||||
|
import { customAlphabet } from 'nanoid';
|
||||||
|
|
||||||
import { flags } from '@/entrypoint/utils/targets';
|
import { flags } from '@/entrypoint/utils/targets';
|
||||||
import { makeEmbed } from '@/providers/base';
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
|
||||||
|
const nanoid = customAlphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 10);
|
||||||
|
|
||||||
export const doodScraper = makeEmbed({
|
export const doodScraper = makeEmbed({
|
||||||
id: 'dood',
|
id: 'dood',
|
||||||
name: 'dood',
|
name: 'dood',
|
||||||
rank: 173,
|
rank: 173,
|
||||||
async scrape(ctx) {
|
async scrape(ctx) {
|
||||||
function makeTheFunny() {
|
|
||||||
let result = '';
|
|
||||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
||||||
const charactersLength = characters.length;
|
|
||||||
|
|
||||||
for (let i = 0; i < 10; i++) {
|
|
||||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseUrl = 'https://do0od.com';
|
const baseUrl = 'https://do0od.com';
|
||||||
|
|
||||||
const id = ctx.url.split('/d/')[1] || ctx.url.split('/e/')[1];
|
const id = ctx.url.split('/d/')[1] || ctx.url.split('/e/')[1];
|
||||||
console.log(id);
|
|
||||||
|
|
||||||
const doodData = await ctx.proxiedFetcher<string>(`/e/${id}`, {
|
const doodData = await ctx.proxiedFetcher<string>(`/e/${id}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
baseUrl,
|
baseUrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log(doodData);
|
const dataForLater = doodData.match(/a\+"\?token=([^"]+)/)?.[1];
|
||||||
|
const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
|
||||||
const dataForLater = doodData.split(`a+"?token=`)[1].split(`"`)[0];
|
|
||||||
const path = doodData.split(`$.get('/pass_md5`)[1].split(`'`)[0];
|
|
||||||
|
|
||||||
const doodPage = await ctx.proxiedFetcher<string>(`/pass_md5/${path}`, {
|
const doodPage = await ctx.proxiedFetcher<string>(`/pass_md5/${path}`, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -41,39 +30,28 @@ export const doodScraper = makeEmbed({
|
|||||||
baseUrl,
|
baseUrl,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`${baseUrl}/pass_md5/${path}`);
|
const downloadURL = `${doodPage}${nanoid()}?token=${dataForLater}${Date.now()}`;
|
||||||
|
|
||||||
console.log(doodPage);
|
if (!downloadURL) throw new Error('dood source not found');
|
||||||
|
|
||||||
// const doodPage = await ctx.proxiedFetcher<string>(`/download/${path}`, { method: 'GET', baseUrl });
|
|
||||||
// console.log(doodPage);
|
|
||||||
const downloadURL = `${doodPage}${makeTheFunny()}?token=${dataForLater}${Date.now()}`;
|
|
||||||
|
|
||||||
if (downloadURL) {
|
|
||||||
return {
|
return {
|
||||||
stream: [
|
stream: [
|
||||||
{
|
{
|
||||||
id: 'primary',
|
id: 'primary',
|
||||||
type: 'file',
|
type: 'file',
|
||||||
url: downloadURL,
|
flags: [],
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
captions: [],
|
||||||
qualities: {
|
qualities: {
|
||||||
unknown: {
|
unknown: {
|
||||||
type: 'mp4',
|
type: 'mp4',
|
||||||
url: downloadURL,
|
url: downloadURL,
|
||||||
preferredHeaders: {
|
headers: {
|
||||||
referer: 'https://do0od.com/',
|
referer: 'https://do0od.com/',
|
||||||
'content-type': 'video/mp4',
|
|
||||||
range: 'bytes=0-',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error('wootly source not found');
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -15,7 +15,7 @@ export const wootlyScraper = makeEmbed({
|
|||||||
readHeaders: ['Set-Cookie'],
|
readHeaders: ['Set-Cookie'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const wootssesCookie = wootlyData.headers.get('Set-Cookie')?.split(';')[0].split('wootsses=')[1];
|
const wootssesCookie = wootlyData.headers.get('Set-Cookie')?.match(/wootsses=([^;]+)/)?.[1];
|
||||||
|
|
||||||
let $ = load(wootlyData.body); // load the html data
|
let $ = load(wootlyData.body); // load the html data
|
||||||
const iframeSrc = $('iframe').attr('src') ?? '';
|
const iframeSrc = $('iframe').attr('src') ?? '';
|
||||||
@@ -28,7 +28,7 @@ export const wootlyScraper = makeEmbed({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const woozCookie = woozCookieRequest.headers.get('Set-Cookie')?.split(';')[0].split('wooz=')[1];
|
const woozCookie = woozCookieRequest.headers.get('Set-Cookie')?.match(/wooz=([^;]+)/)?.[1];
|
||||||
|
|
||||||
const iframeData = await ctx.proxiedFetcher<string>(iframeSrc, {
|
const iframeData = await ctx.proxiedFetcher<string>(iframeSrc, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -45,8 +45,10 @@ export const wootlyScraper = makeEmbed({
|
|||||||
|
|
||||||
// Regular expressions to match the variables
|
// Regular expressions to match the variables
|
||||||
|
|
||||||
const tk = scriptText.split('tk=')[1].split(';')[0].replaceAll('"', '').replaceAll(' ', '');
|
const tk = scriptText.match(/tk=([^;]+)/)?.[0].replace(/tk=|["\s]/g, '');
|
||||||
const vd = scriptText.split('vd=')[1].split(',')[0].replaceAll('"', '').replaceAll(' ', '');
|
const vd = scriptText.match(/vd=([^,]+)/)?.[0].replace(/vd=|["\s]/g, '');
|
||||||
|
|
||||||
|
if (!tk || !vd) throw new Error('wootly source not found');
|
||||||
|
|
||||||
const url = await ctx.proxiedFetcher<string>(`/grabd`, {
|
const url = await ctx.proxiedFetcher<string>(`/grabd`, {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
@@ -57,14 +59,15 @@ export const wootlyScraper = makeEmbed({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (url) {
|
if (!url) throw new Error('wootly source not found');
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stream: [
|
stream: [
|
||||||
{
|
{
|
||||||
id: 'primary',
|
id: 'primary',
|
||||||
type: 'file',
|
type: 'file',
|
||||||
url,
|
url,
|
||||||
flags: [flags.CORS_ALLOWED, flags.IP_LOCKED],
|
flags: [flags.IP_LOCKED],
|
||||||
captions: [],
|
captions: [],
|
||||||
qualities: {
|
qualities: {
|
||||||
unknown: {
|
unknown: {
|
||||||
@@ -75,8 +78,5 @@ export const wootlyScraper = makeEmbed({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error('wootly source not found');
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -8,16 +8,14 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise<EmbedsR
|
|||||||
const data = await ctx.fetcher.full(`/${id}`, {
|
const data = await ctx.fetcher.full(`/${id}`, {
|
||||||
baseUrl: 'https://ww1.goojara.to',
|
baseUrl: 'https://ww1.goojara.to',
|
||||||
headers: {
|
headers: {
|
||||||
accept: '*/*',
|
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
|
||||||
Referer: 'https://www.goojara.to/',
|
Referer: 'https://www.goojara.to/',
|
||||||
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
|
||||||
},
|
},
|
||||||
readHeaders: ['Set-Cookie'],
|
readHeaders: ['Set-Cookie'],
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
});
|
});
|
||||||
|
|
||||||
const aGoozCookie = data.headers.get('Set-Cookie')?.split(';')[0].split('aGooz=')[1];
|
const aGoozCookie = data.headers.get('Set-Cookie')?.match(/aGooz=([^;]+)/)?.[1];
|
||||||
|
|
||||||
const $ = load(data.body);
|
const $ = load(data.body);
|
||||||
const RandomCookieName = data.body.split(`_3chk('`)[1].split(`'`)[0];
|
const RandomCookieName = data.body.split(`_3chk('`)[1].split(`'`)[0];
|
||||||
const RandomCookieValue = data.body.split(`_3chk('`)[1].split(`'`)[2];
|
const RandomCookieValue = data.body.split(`_3chk('`)[1].split(`'`)[2];
|
||||||
@@ -27,8 +25,9 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise<EmbedsR
|
|||||||
.get()
|
.get()
|
||||||
.filter((href) => href && href.includes('https://ww1.goojara.to/go.php'));
|
.filter((href) => href && href.includes('https://ww1.goojara.to/go.php'));
|
||||||
|
|
||||||
const embeds = await Promise.all(
|
const embedPages = await Promise.all(
|
||||||
embedRedirectURLs.map((url) =>
|
embedRedirectURLs.map(
|
||||||
|
(url) =>
|
||||||
ctx.fetcher
|
ctx.fetcher
|
||||||
.full(url, {
|
.full(url, {
|
||||||
headers: {
|
headers: {
|
||||||
@@ -37,16 +36,25 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise<EmbedsR
|
|||||||
},
|
},
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.catch(() => null), // Handle errors gracefully
|
||||||
if (result) {
|
|
||||||
const embedId = ['wootly', 'upstream', 'mixdrop', 'dood'].find((a) => result.finalUrl.includes(a));
|
|
||||||
return embedId ? { embedId, url: result.finalUrl } : null;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
})
|
|
||||||
.catch(() => null),
|
|
||||||
),
|
),
|
||||||
).then((results) => results.filter((result) => result !== null) as EmbedsResult);
|
);
|
||||||
|
|
||||||
return embeds;
|
// Initialize an array to hold the results
|
||||||
|
const results = [];
|
||||||
|
|
||||||
|
// Process each page result
|
||||||
|
for (const result of embedPages) {
|
||||||
|
// Ensure there's a result to process
|
||||||
|
if (result) {
|
||||||
|
// Attempt to find a matching embed ID
|
||||||
|
const embedId = ['wootly', 'upstream', 'mixdrop', 'dood'].find((a) => result.finalUrl.includes(a));
|
||||||
|
// If an embed ID is found, push the result to the results array
|
||||||
|
if (embedId) {
|
||||||
|
results.push({ embedId, url: result.finalUrl });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
@@ -22,7 +22,7 @@ async function universalScraper(ctx: ShowScrapeContext | MovieScrapeContext): Pr
|
|||||||
export const goojaraScraper = makeSourcerer({
|
export const goojaraScraper = makeSourcerer({
|
||||||
id: 'goojara',
|
id: 'goojara',
|
||||||
name: 'goojara',
|
name: 'goojara',
|
||||||
rank: 69,
|
rank: 225,
|
||||||
flags: [],
|
flags: [],
|
||||||
scrapeShow: universalScraper,
|
scrapeShow: universalScraper,
|
||||||
scrapeMovie: universalScraper,
|
scrapeMovie: universalScraper,
|
||||||
|
@@ -1,33 +1,8 @@
|
|||||||
// ! Types
|
|
||||||
interface BaseConfig {
|
|
||||||
/** The website's slug. Formatted as `1839578-person-of-interest-2011` */
|
|
||||||
slug: string;
|
|
||||||
/** Type of request */
|
|
||||||
type: 'show' | 'movie';
|
|
||||||
/** Hash */
|
|
||||||
hash: string;
|
|
||||||
/** Hash expiry */
|
|
||||||
expires: number;
|
|
||||||
}
|
|
||||||
interface TvConfig extends BaseConfig {
|
|
||||||
/** Type of request */
|
|
||||||
type: 'show';
|
|
||||||
/** The episode ID for a TV show. Given in search and URL */
|
|
||||||
episodeId: string;
|
|
||||||
}
|
|
||||||
interface MovieConfig extends BaseConfig {
|
|
||||||
/** Type of request */
|
|
||||||
type: 'movie';
|
|
||||||
/** Movie's id */
|
|
||||||
slug: string;
|
|
||||||
}
|
|
||||||
export type Config = MovieConfig | TvConfig;
|
|
||||||
|
|
||||||
export type EmbedsResult = { embedId: string; url: string }[];
|
export type EmbedsResult = { embedId: string; url: string }[];
|
||||||
|
|
||||||
export interface Result {
|
export interface Result {
|
||||||
title: string;
|
title: string;
|
||||||
slug: any;
|
slug: string;
|
||||||
year: string;
|
year: string;
|
||||||
type: string;
|
type: string;
|
||||||
id_movie?: string;
|
id_movie?: string;
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
import { load } from 'cheerio';
|
import { load } from 'cheerio';
|
||||||
|
import { stringify } from 'crypto-js/enc-base64';
|
||||||
|
|
||||||
import { MovieMedia, ShowMedia } from '@/entrypoint/utils/media';
|
import { MovieMedia, ShowMedia } from '@/entrypoint/utils/media';
|
||||||
import { compareMedia } from '@/utils/compare';
|
import { compareMedia } from '@/utils/compare';
|
||||||
@@ -8,30 +9,24 @@ import { NotFoundError } from '@/utils/errors';
|
|||||||
import { getEmbeds } from './getEmbeds';
|
import { getEmbeds } from './getEmbeds';
|
||||||
import { EmbedsResult, Result } from './type';
|
import { EmbedsResult, Result } from './type';
|
||||||
|
|
||||||
|
let data;
|
||||||
|
|
||||||
|
// The cookie for this headerData doesn't matter, Goojara just checks it's there. T
|
||||||
const headersData = {
|
const headersData = {
|
||||||
accept: '*/*',
|
|
||||||
'accept-language': 'en-US,en;q=0.9',
|
|
||||||
'content-type': 'application/x-www-form-urlencoded',
|
'content-type': 'application/x-www-form-urlencoded',
|
||||||
'sec-ch-ua': '"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"',
|
|
||||||
'sec-ch-ua-mobile': '?0',
|
|
||||||
'sec-ch-ua-platform': '"Windows"',
|
|
||||||
'sec-fetch-dest': 'empty',
|
|
||||||
'sec-fetch-mode': 'cors',
|
|
||||||
'sec-fetch-site': 'same-origin',
|
|
||||||
cookie: `aGooz=t9pmkdtef1b3lg3pmo1u2re816; bd9aa48e=0d7b89e8c79844e9df07a2; _b414=2151C6B12E2A88379AFF2C0DD65AC8298DEC2BF4; 9d287aaa=8f32ad589e1c4288fe152f`,
|
cookie: `aGooz=t9pmkdtef1b3lg3pmo1u2re816; bd9aa48e=0d7b89e8c79844e9df07a2; _b414=2151C6B12E2A88379AFF2C0DD65AC8298DEC2BF4; 9d287aaa=8f32ad589e1c4288fe152f`,
|
||||||
Referer: 'https://www.goojara.to/',
|
Referer: 'https://www.goojara.to/',
|
||||||
'Referrer-Policy': 'strict-origin-when-cross-origin',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function searchAndFindMedia(
|
export async function searchAndFindMedia(
|
||||||
ctx: ScrapeContext,
|
ctx: ScrapeContext,
|
||||||
media: MovieMedia | ShowMedia,
|
media: MovieMedia | ShowMedia,
|
||||||
): Promise<Result | undefined> {
|
): Promise<Result | undefined> {
|
||||||
const data = await ctx.fetcher<string>(`/xhrr.php`, {
|
data = await ctx.fetcher<string>(`/xhrr.php`, {
|
||||||
baseUrl: 'https://www.goojara.to',
|
baseUrl: 'https://www.goojara.to',
|
||||||
headers: headersData,
|
headers: headersData,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: `q=${media.title}`,
|
body: new URLSearchParams({ q: media.title }),
|
||||||
});
|
});
|
||||||
|
|
||||||
const $ = load(data);
|
const $ = load(data);
|
||||||
@@ -48,6 +43,8 @@ export async function searchAndFindMedia(
|
|||||||
const year = yearMatch ? yearMatch[1] : '';
|
const year = yearMatch ? yearMatch[1] : '';
|
||||||
const slug = $(element).find('a').attr('href')?.split('/')[3];
|
const slug = $(element).find('a').attr('href')?.split('/')[3];
|
||||||
|
|
||||||
|
if (!slug) throw new NotFoundError('Not found');
|
||||||
|
|
||||||
if (media.type === type) {
|
if (media.type === type) {
|
||||||
results.push({ title, year, slug, type });
|
results.push({ title, year, slug, type });
|
||||||
}
|
}
|
||||||
@@ -68,7 +65,7 @@ export async function scrapeIds(
|
|||||||
if (media.type === 'movie') {
|
if (media.type === 'movie') {
|
||||||
id = result.slug;
|
id = result.slug;
|
||||||
} else if (media.type === 'show') {
|
} else if (media.type === 'show') {
|
||||||
const data = await ctx.fetcher<string>(`/${result.slug}`, {
|
data = await ctx.fetcher<string>(`/${result.slug}`, {
|
||||||
baseUrl: 'https://www.goojara.to',
|
baseUrl: 'https://www.goojara.to',
|
||||||
headers: headersData,
|
headers: headersData,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -76,18 +73,20 @@ export async function scrapeIds(
|
|||||||
|
|
||||||
const $1 = load(data);
|
const $1 = load(data);
|
||||||
|
|
||||||
const dataId = $1('#seon').data('id');
|
const dataId = $1('#seon').attr('data-id');
|
||||||
|
|
||||||
const data2 = await ctx.fetcher<string>(`/xhrc.php`, {
|
if (!dataId) throw NotFoundError;
|
||||||
|
|
||||||
|
data = await ctx.fetcher<string>(`/xhrc.php`, {
|
||||||
baseUrl: 'https://ww1.goojara.to',
|
baseUrl: 'https://ww1.goojara.to',
|
||||||
headers: headersData,
|
headers: headersData,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: `s=${media.season.number}&t=${dataId}`,
|
body: new URLSearchParams({ s: media.season.number.toString(), t: dataId }),
|
||||||
});
|
});
|
||||||
|
|
||||||
let episodeId = '';
|
let episodeId = '';
|
||||||
|
|
||||||
const $2 = load(data2);
|
const $2 = load(data);
|
||||||
|
|
||||||
$2('.seho').each((index, element) => {
|
$2('.seho').each((index, element) => {
|
||||||
// Extracting the episode number as a string
|
// Extracting the episode number as a string
|
||||||
|
Reference in New Issue
Block a user