Merge branch 'dev' into fix-upcloud-captions

This commit is contained in:
William Oldham
2024-02-29 13:05:26 +00:00
committed by GitHub
15 changed files with 51 additions and 54 deletions

View File

@@ -2,7 +2,7 @@
## What is `@movie-web/providers`? ## What is `@movie-web/providers`?
`@movie-web/providers` is the soul of [movie-web.app](https://movie-web.app). It's a collection of scrapers of various streaming sites. It extracts the raw streams from those sites, so you can watch them without any extra fluff from the original sites. `@movie-web/providers` is the soul of [movie-web](https://github.com/movie-web/movie-web). It's a collection of scrapers of various streaming sites. It extracts the raw streams from those sites, so you can watch them without any extra fluff from the original sites.
## What can I use this on? ## What can I use this on?

View File

@@ -2,6 +2,9 @@
title: 'Changelog' title: 'Changelog'
--- ---
# Version 2.2.1
- Fixed Closeload scraper
# Version 2.2.0 # Version 2.2.0
- Fixed vidsrc.me URL decoding. - Fixed vidsrc.me URL decoding.
- Added ridomovies with Ridoo and Closeload embed. - Added ridomovies with Ridoo and Closeload embed.

View File

@@ -17,7 +17,7 @@ import { makeProviders, makeStandardFetcher, targets } from '@movie-web/provider
const providers = makeProviders({ const providers = makeProviders({
fetcher: makeStandardFetcher(fetch), fetcher: makeStandardFetcher(fetch),
target: chooseYourself, // check out https://providers.docs.movie-web.app/essentials/targets target: chooseYourself, // check out https://movie-web.github.io/providers/essentials/targets
}) })
``` ```

View File

@@ -7627,9 +7627,9 @@
} }
}, },
"node_modules/ip": { "node_modules/ip": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",
"integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==",
"dev": true "dev": true
}, },
"node_modules/iron-webcrypto": { "node_modules/iron-webcrypto": {
@@ -16642,9 +16642,9 @@
} }
}, },
"node_modules/undici": { "node_modules/undici": {
"version": "5.27.2", "version": "5.28.3",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.27.2.tgz", "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz",
"integrity": "sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ==", "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@fastify/busboy": "^2.0.0" "@fastify/busboy": "^2.0.0"

2
.github/SECURITY.md vendored
View File

@@ -11,4 +11,4 @@ Support is not provided for any forks or mirrors of movie-web.
There are two ways you can contact the movie-web maintainers to report a vulnerability: There are two ways you can contact the movie-web maintainers to report a vulnerability:
- Email [security@movie-web.app](mailto:security@movie-web.app) - Email [security@movie-web.app](mailto:security@movie-web.app)
- Report the vulnerability in the [movie-web Discord server](https://discord.movie-web.app) - Report the vulnerability in the [movie-web Discord server](https://discord.gg/gQYB6fGArX)

View File

@@ -26,6 +26,8 @@ jobs:
- name: Build project - name: Build project
working-directory: ./.docs working-directory: ./.docs
run: npm run generate run: npm run generate
env:
NUXT_APP_BASE_URL: /providers/
- name: Upload production-ready build files - name: Upload production-ready build files
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v1

View File

@@ -7,8 +7,8 @@ features:
- scrape popular streaming websites - scrape popular streaming websites
- works in both browser and server-side - works in both browser and server-side
Visit documentation here: https://providers.docs.movie-web.app/ Visit documentation here: https://movie-web.github.io/providers/
## How to run locally or test my changes ## How to run locally or test my changes
These topics are also covered in the documentation, [read about it here](https://providers.docs.movie-web.app/extra-topics/development). These topics are also covered in the documentation, [read about it here](https://movie-web.github.io/providers/extra-topics/development).

16
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "@movie-web/providers", "name": "@movie-web/providers",
"version": "2.2.0", "version": "2.2.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@movie-web/providers", "name": "@movie-web/providers",
"version": "2.2.0", "version": "2.2.1",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"cheerio": "^1.0.0-rc.12", "cheerio": "^1.0.0-rc.12",
@@ -3357,9 +3357,9 @@
} }
}, },
"node_modules/ip": { "node_modules/ip": {
"version": "1.1.8", "version": "1.1.9",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.9.tgz",
"integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==", "integrity": "sha512-cyRxvOEpNHNtchU3Ln9KC/auJgup87llfQpQ+t5ghoC/UhL16SWzbueiCsdTnWmqAWl7LadfuwhlqmtOaqMHdQ==",
"dev": true "dev": true
}, },
"node_modules/is-array-buffer": { "node_modules/is-array-buffer": {
@@ -4937,9 +4937,9 @@
} }
}, },
"node_modules/socks/node_modules/ip": { "node_modules/socks/node_modules/ip": {
"version": "2.0.0", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.1.tgz",
"integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", "integrity": "sha512-lJUL9imLTNi1ZfXT+DU6rBBdbiKGBuay9B6xGSPVjUeQwaH1RIGqef8RZkUtHioLmSNpPR5M4HVKJGm1j8FWVQ==",
"dev": true "dev": true
}, },
"node_modules/source-map": { "node_modules/source-map": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@movie-web/providers", "name": "@movie-web/providers",
"version": "2.2.0", "version": "2.2.1",
"description": "Package that contains all the providers of movie-web", "description": "Package that contains all the providers of movie-web",
"main": "./lib/index.umd.js", "main": "./lib/index.umd.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
@@ -32,7 +32,7 @@
"bugs": { "bugs": {
"url": "https://github.com/movie-web/providers/issues" "url": "https://github.com/movie-web/providers/issues"
}, },
"homepage": "https://providers.docs.movie-web.app/", "homepage": "https://movie-web.github.io/providers/",
"scripts": { "scripts": {
"build": "vite build && tsc --noEmit", "build": "vite build && tsc --noEmit",
"cli": "ts-node ./src/dev-cli/index.ts", "cli": "ts-node ./src/dev-cli/index.ts",

View File

@@ -43,7 +43,7 @@ export const closeLoadScraper = makeEmbed({
const evalCode = iframeRes$('script') const evalCode = iframeRes$('script')
.filter((_, el) => { .filter((_, el) => {
const script = iframeRes$(el); const script = iframeRes$(el);
return (script.attr('type') === 'text/javascript' && script.html()?.includes('eval')) ?? false; return (script.attr('type') === 'text/javascript' && script.html()?.includes('p,a,c,k,e,d')) ?? false;
}) })
.html(); .html();
if (!evalCode) throw new Error("Couldn't find eval code"); if (!evalCode) throw new Error("Couldn't find eval code");

View File

@@ -9,7 +9,7 @@ export const doodScraper = makeEmbed({
name: 'dood', name: 'dood',
rank: 173, rank: 173,
async scrape(ctx) { async scrape(ctx) {
const baseUrl = 'https://do0od.com'; const baseUrl = 'https://d0000d.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];
@@ -18,18 +18,17 @@ export const doodScraper = makeEmbed({
baseUrl, baseUrl,
}); });
const dataForLater = doodData.match(/a\+"\?token=([^"]+)/)?.[1]; const dataForLater = doodData.match(/\?token=([^&]+)&expiry=/)?.[1];
const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1]; const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1];
const doodPage = await ctx.proxiedFetcher<string>(`/pass_md5/${path}`, { const doodPage = await ctx.proxiedFetcher<string>(`/pass_md5${path}`, {
headers: { headers: {
referer: `${baseUrl}/e/${id}`, Referer: `${baseUrl}/e/${id}`,
}, },
method: 'GET', method: 'GET',
baseUrl, baseUrl,
}); });
const downloadURL = `${doodPage}${nanoid()}?token=${dataForLater}&expiry=${Date.now()}`;
const downloadURL = `${doodPage}${nanoid()}?token=${dataForLater}${Date.now()}`;
return { return {
stream: [ stream: [
@@ -43,7 +42,7 @@ export const doodScraper = makeEmbed({
type: 'mp4', type: 'mp4',
url: downloadURL, url: downloadURL,
headers: { headers: {
referer: 'https://do0od.com/', Referer: 'https://d0000d.com/',
}, },
}, },
}, },

View File

@@ -10,18 +10,28 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise<EmbedsR
baseUrl: baseUrl2, baseUrl: baseUrl2,
headers: { headers: {
Referer: baseUrl, Referer: baseUrl,
cookie: '',
}, },
readHeaders: ['Set-Cookie'], readHeaders: ['Set-Cookie'],
method: 'GET', method: 'GET',
}); });
const cookies = parseSetCookie(data.headers.get('Set-Cookie') || ''); const cookies = parseSetCookie(data.headers.get('Set-Cookie') || '');
const aGoozCookie = cookies.aGooz.value;
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];
let aGoozCookie = '';
let cookie = '';
if (cookies && cookies.aGooz && RandomCookieName && RandomCookieValue) {
aGoozCookie = cookies.aGooz.value;
cookie = makeCookieHeader({
aGooz: aGoozCookie,
[RandomCookieName]: RandomCookieValue,
});
}
const $ = load(data.body);
const embedRedirectURLs = $('a') const embedRedirectURLs = $('a')
.map((index, element) => $(element).attr('href')) .map((index, element) => $(element).attr('href'))
.get() .get()
@@ -33,10 +43,7 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise<EmbedsR
ctx.fetcher ctx.fetcher
.full(url, { .full(url, {
headers: { headers: {
cookie: makeCookieHeader({ cookie,
aGooz: aGoozCookie,
[RandomCookieName]: RandomCookieValue,
}),
Referer: baseUrl2, Referer: baseUrl2,
}, },
method: 'GET', method: 'GET',

View File

@@ -21,7 +21,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: 225, rank: 225,
flags: [], flags: [],
scrapeShow: universalScraper, scrapeShow: universalScraper,

View File

@@ -49,7 +49,6 @@ export async function searchAndFindMedia(
}); });
const result = results.find((res: Result) => compareMedia(media, res.title, Number(res.year))); const result = results.find((res: Result) => compareMedia(media, res.title, Number(res.year)));
return result; return result;
} }
@@ -67,19 +66,7 @@ export async function scrapeIds(
baseUrl, baseUrl,
headers: headersData, headers: headersData,
method: 'GET', method: 'GET',
}); query: { s: media.season.number.toString() },
const $1 = load(data);
const dataId = $1('#seon').attr('data-id');
if (!dataId) throw new NotFoundError('Not found');
data = await ctx.fetcher<string>(`/xhrc.php`, {
baseUrl,
headers: headersData,
method: 'POST',
body: new URLSearchParams({ s: media.season.number.toString(), t: dataId }),
}); });
let episodeId = ''; let episodeId = '';
@@ -89,7 +76,6 @@ export async function scrapeIds(
$2('.seho').each((index, element) => { $2('.seho').each((index, element) => {
// Extracting the episode number as a string // Extracting the episode number as a string
const episodeNumber = $2(element).find('.seep .sea').text().trim(); const episodeNumber = $2(element).find('.seep .sea').text().trim();
// Comparing with the desired episode number as a string // Comparing with the desired episode number as a string
if (parseInt(episodeNumber, 10) === media.episode.number) { if (parseInt(episodeNumber, 10) === media.episode.number) {
const href = $2(element).find('.snfo h1 a').attr('href'); const href = $2(element).find('.snfo h1 a').attr('href');

View File

@@ -28,9 +28,9 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
const showPageResult = await ctx.proxiedFetcher<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 = `season-${ctx.media.season.number}/episode-${ctx.media.episode.number}`;
const regexPattern = new RegExp( const regexPattern = new RegExp(
`\\\\"id\\\\":\\\\"(\\d+)\\\\"(?=.*?\\\\\\"fullSlug\\\\\\":\\\\\\"${fullEpisodeSlug}\\\\\\")`, `\\\\"id\\\\":\\\\"(\\d+)\\\\"(?=.*?\\\\\\"fullSlug\\\\\\":\\\\\\"[^"]*${fullEpisodeSlug}[^"]*\\\\\\")`,
'g', 'g',
); );
const matches = [...showPageResult.matchAll(regexPattern)]; const matches = [...showPageResult.matchAll(regexPattern)];