diff --git a/.docs/content/1.get-started/0.introduction.md b/.docs/content/1.get-started/0.introduction.md index eb21056..6807b20 100644 --- a/.docs/content/1.get-started/0.introduction.md +++ b/.docs/content/1.get-started/0.introduction.md @@ -2,7 +2,7 @@ ## 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? diff --git a/.docs/content/1.get-started/4.changelog.md b/.docs/content/1.get-started/4.changelog.md index 9464b1e..a9d6f33 100644 --- a/.docs/content/1.get-started/4.changelog.md +++ b/.docs/content/1.get-started/4.changelog.md @@ -2,6 +2,12 @@ title: 'Changelog' --- +# Version 2.2.2 +- Fix subtitles not appearing if the name of the subtitle is in its native tongue. +- Remove references to the old domain +- Fixed ridomovies not working for some shows and movies +- Fixed Showbox not working in react-native. + # Version 2.2.1 - Fixed Closeload scraper diff --git a/.docs/content/2.essentials/0.usage-on-x.md b/.docs/content/2.essentials/0.usage-on-x.md index 5294be4..0c7443d 100644 --- a/.docs/content/2.essentials/0.usage-on-x.md +++ b/.docs/content/2.essentials/0.usage-on-x.md @@ -17,7 +17,7 @@ import { makeProviders, makeStandardFetcher, targets } from '@movie-web/provider const providers = makeProviders({ 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 }) ``` diff --git a/.github/SECURITY.md b/.github/SECURITY.md index c8ee568..5854baf 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -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: - 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://movie-web.github.io/links/discord) diff --git a/README.md b/README.md index a0cadad..ebc7991 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ features: - scrape popular streaming websites - 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 -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). diff --git a/package-lock.json b/package-lock.json index 1fc4ea9..d73ef35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@movie-web/providers", - "version": "2.2.0", + "version": "2.2.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@movie-web/providers", - "version": "2.2.0", + "version": "2.2.2", "license": "MIT", "dependencies": { "cheerio": "^1.0.0-rc.12", diff --git a/package.json b/package.json index 9b71320..04e2a99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@movie-web/providers", - "version": "2.2.1", + "version": "2.2.2", "description": "Package that contains all the providers of movie-web", "main": "./lib/index.umd.js", "types": "./lib/index.d.ts", @@ -32,7 +32,7 @@ "bugs": { "url": "https://github.com/movie-web/providers/issues" }, - "homepage": "https://providers.docs.movie-web.app/", + "homepage": "https://movie-web.github.io/providers/", "scripts": { "build": "vite build && tsc --noEmit", "cli": "ts-node ./src/dev-cli/index.ts", diff --git a/src/fetchers/body.ts b/src/fetchers/body.ts index 44438e5..c859a2a 100644 --- a/src/fetchers/body.ts +++ b/src/fetchers/body.ts @@ -1,6 +1,7 @@ import FormData from 'form-data'; import { FetcherOptions } from '@/fetchers/types'; +import { isReactNative } from '@/utils/native'; export interface SeralizedBody { headers: Record; @@ -8,11 +9,20 @@ export interface SeralizedBody { } export function serializeBody(body: FetcherOptions['body']): SeralizedBody { - if (body === undefined || typeof body === 'string' || body instanceof URLSearchParams || body instanceof FormData) + if (body === undefined || typeof body === 'string' || body instanceof URLSearchParams || body instanceof FormData) { + if (body instanceof URLSearchParams && isReactNative()) { + return { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: body.toString(), + }; + } return { headers: {}, body, }; + } // serialize as JSON return { diff --git a/src/providers/embeds/dood.ts b/src/providers/embeds/dood.ts index faa79d8..4eff019 100644 --- a/src/providers/embeds/dood.ts +++ b/src/providers/embeds/dood.ts @@ -9,7 +9,7 @@ export const doodScraper = makeEmbed({ name: 'dood', rank: 173, 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]; @@ -18,18 +18,17 @@ export const doodScraper = makeEmbed({ baseUrl, }); - const dataForLater = doodData.match(/a\+"\?token=([^"]+)/)?.[1]; + const dataForLater = doodData.match(/\?token=([^&]+)&expiry=/)?.[1]; const path = doodData.match(/\$\.get\('\/pass_md5([^']+)/)?.[1]; - const doodPage = await ctx.proxiedFetcher(`/pass_md5/${path}`, { + const doodPage = await ctx.proxiedFetcher(`/pass_md5${path}`, { headers: { - referer: `${baseUrl}/e/${id}`, + Referer: `${baseUrl}/e/${id}`, }, method: 'GET', baseUrl, }); - - const downloadURL = `${doodPage}${nanoid()}?token=${dataForLater}${Date.now()}`; + const downloadURL = `${doodPage}${nanoid()}?token=${dataForLater}&expiry=${Date.now()}`; return { stream: [ @@ -42,11 +41,11 @@ export const doodScraper = makeEmbed({ unknown: { type: 'mp4', url: downloadURL, - headers: { - referer: 'https://do0od.com/', - }, }, }, + headers: { + Referer: 'https://d0000d.com/', + }, }, ], }; diff --git a/src/providers/embeds/upcloud.ts b/src/providers/embeds/upcloud.ts index 0f86cd0..663bb3d 100644 --- a/src/providers/embeds/upcloud.ts +++ b/src/providers/embeds/upcloud.ts @@ -110,7 +110,7 @@ export const upcloudScraper = makeEmbed({ if (track.kind !== 'captions') return; const type = getCaptionTypeFromUrl(track.file); if (!type) return; - const language = labelToLanguageCode(track.label); + const language = labelToLanguageCode(track.label.split(' ')[0]); if (!language) return; captions.push({ id: track.file, diff --git a/src/providers/sources/goojara/getEmbeds.ts b/src/providers/sources/goojara/getEmbeds.ts index 50f574a..7b26d6c 100644 --- a/src/providers/sources/goojara/getEmbeds.ts +++ b/src/providers/sources/goojara/getEmbeds.ts @@ -10,18 +10,28 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise $(element).attr('href')) .get() @@ -33,10 +43,7 @@ export async function getEmbeds(ctx: ScrapeContext, id: string): Promise compareMedia(media, res.title, Number(res.year))); - return result; } @@ -67,19 +66,7 @@ export async function scrapeIds( baseUrl, headers: headersData, method: 'GET', - }); - - const $1 = load(data); - - const dataId = $1('#seon').attr('data-id'); - - if (!dataId) throw new NotFoundError('Not found'); - - data = await ctx.fetcher(`/xhrc.php`, { - baseUrl, - headers: headersData, - method: 'POST', - body: new URLSearchParams({ s: media.season.number.toString(), t: dataId }), + query: { s: media.season.number.toString() }, }); let episodeId = ''; @@ -89,7 +76,6 @@ export async function scrapeIds( $2('.seho').each((index, element) => { // Extracting the episode number as a string const episodeNumber = $2(element).find('.seep .sea').text().trim(); - // Comparing with the desired episode number as a string if (parseInt(episodeNumber, 10) === media.episode.number) { const href = $2(element).find('.snfo h1 a').attr('href'); diff --git a/src/providers/sources/ridomovies/index.ts b/src/providers/sources/ridomovies/index.ts index f028875..fba442a 100644 --- a/src/providers/sources/ridomovies/index.ts +++ b/src/providers/sources/ridomovies/index.ts @@ -28,9 +28,9 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => const showPageResult = await ctx.proxiedFetcher(`/${show.fullSlug}`, { 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( - `\\\\"id\\\\":\\\\"(\\d+)\\\\"(?=.*?\\\\\\"fullSlug\\\\\\":\\\\\\"${fullEpisodeSlug}\\\\\\")`, + `\\\\"id\\\\":\\\\"(\\d+)\\\\"(?=.*?\\\\\\"fullSlug\\\\\\":\\\\\\"[^"]*${fullEpisodeSlug}[^"]*\\\\\\")`, 'g', ); const matches = [...showPageResult.matchAll(regexPattern)]; diff --git a/src/utils/native.ts b/src/utils/native.ts new file mode 100644 index 0000000..cc91cdb --- /dev/null +++ b/src/utils/native.ts @@ -0,0 +1,9 @@ +export const isReactNative = () => { + try { + // eslint-disable-next-line global-require, @typescript-eslint/no-var-requires + require('react-native'); + return true; + } catch (e) { + return false; + } +};