mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 12:43:25 +00:00
Compare commits
1 Commits
master
...
1ec8943c90
Author | SHA1 | Date | |
---|---|---|---|
|
1ec8943c90 |
@@ -2,11 +2,6 @@
|
|||||||
title: 'Changelog'
|
title: 'Changelog'
|
||||||
---
|
---
|
||||||
|
|
||||||
# Version 2.3.0
|
|
||||||
- Fixed RidoMovies search results
|
|
||||||
- Added Insertunit, SoaperTV, and WarezCDN providers
|
|
||||||
- Disabled Showbox and VidSrc
|
|
||||||
|
|
||||||
# Version 2.2.9
|
# Version 2.2.9
|
||||||
- Fixed VidSrcTo (both Vidplay and Filemoon embeds)
|
- Fixed VidSrcTo (both Vidplay and Filemoon embeds)
|
||||||
- Added dropload, filelions and vtube embeds to Primewire
|
- Added dropload, filelions and vtube embeds to Primewire
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@movie-web/providers",
|
"name": "@movie-web/providers",
|
||||||
"version": "2.3.0",
|
"version": "2.2.9",
|
||||||
"description": "Package that contains all the providers of movie-web",
|
"description": "Package that contains all the providers of movie-web",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
|
@@ -32,8 +32,6 @@ import { streamvidScraper } from './embeds/streamvid';
|
|||||||
import { vidCloudScraper } from './embeds/vidcloud';
|
import { vidCloudScraper } from './embeds/vidcloud';
|
||||||
import { vidplayScraper } from './embeds/vidplay';
|
import { vidplayScraper } from './embeds/vidplay';
|
||||||
import { voeScraper } from './embeds/voe';
|
import { voeScraper } from './embeds/voe';
|
||||||
import { warezcdnembedHlsScraper } from './embeds/warezcdn/hls';
|
|
||||||
import { warezcdnembedMp4Scraper } from './embeds/warezcdn/mp4';
|
|
||||||
import { wootlyScraper } from './embeds/wootly';
|
import { wootlyScraper } from './embeds/wootly';
|
||||||
import { goojaraScraper } from './sources/goojara';
|
import { goojaraScraper } from './sources/goojara';
|
||||||
import { hdRezkaScraper } from './sources/hdrezka';
|
import { hdRezkaScraper } from './sources/hdrezka';
|
||||||
@@ -41,9 +39,7 @@ import { nepuScraper } from './sources/nepu';
|
|||||||
import { primewireScraper } from './sources/primewire';
|
import { primewireScraper } from './sources/primewire';
|
||||||
import { ridooMoviesScraper } from './sources/ridomovies';
|
import { ridooMoviesScraper } from './sources/ridomovies';
|
||||||
import { smashyStreamScraper } from './sources/smashystream';
|
import { smashyStreamScraper } from './sources/smashystream';
|
||||||
import { soaperTvScraper } from './sources/soapertv';
|
|
||||||
import { vidSrcToScraper } from './sources/vidsrcto';
|
import { vidSrcToScraper } from './sources/vidsrcto';
|
||||||
import { warezcdnScraper } from './sources/warezcdn';
|
|
||||||
|
|
||||||
export function gatherAllSources(): Array<Sourcerer> {
|
export function gatherAllSources(): Array<Sourcerer> {
|
||||||
// all sources are gathered here
|
// all sources are gathered here
|
||||||
@@ -63,9 +59,7 @@ export function gatherAllSources(): Array<Sourcerer> {
|
|||||||
goojaraScraper,
|
goojaraScraper,
|
||||||
hdRezkaScraper,
|
hdRezkaScraper,
|
||||||
primewireScraper,
|
primewireScraper,
|
||||||
warezcdnScraper,
|
|
||||||
insertunitScraper,
|
insertunitScraper,
|
||||||
soaperTvScraper,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +90,5 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||||||
droploadScraper,
|
droploadScraper,
|
||||||
filelionsScraper,
|
filelionsScraper,
|
||||||
vTubeScraper,
|
vTubeScraper,
|
||||||
warezcdnembedHlsScraper,
|
|
||||||
warezcdnembedMp4Scraper,
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -1,58 +0,0 @@
|
|||||||
import { warezcdnPlayerBase } from '@/providers/sources/warezcdn/common';
|
|
||||||
import { EmbedScrapeContext } from '@/utils/context';
|
|
||||||
import { NotFoundError } from '@/utils/errors';
|
|
||||||
|
|
||||||
function decrypt(input: string) {
|
|
||||||
let output = atob(input);
|
|
||||||
|
|
||||||
// Remove leading and trailing whitespaces
|
|
||||||
output = output.trim();
|
|
||||||
|
|
||||||
// Reverse the string
|
|
||||||
output = output.split('').reverse().join('');
|
|
||||||
|
|
||||||
// Get the last 5 characters and reverse them
|
|
||||||
let last = output.slice(-5);
|
|
||||||
last = last.split('').reverse().join('');
|
|
||||||
|
|
||||||
// Remove the last 5 characters from the original string
|
|
||||||
output = output.slice(0, -5);
|
|
||||||
|
|
||||||
// Return the original string concatenated with the reversed last 5 characters
|
|
||||||
return `${output}${last}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getDecryptedId(ctx: EmbedScrapeContext) {
|
|
||||||
const page = await ctx.proxiedFetcher<string>(`/player.php`, {
|
|
||||||
baseUrl: warezcdnPlayerBase,
|
|
||||||
headers: {
|
|
||||||
Referer: `${warezcdnPlayerBase}/getEmbed.php?${new URLSearchParams({
|
|
||||||
id: ctx.url,
|
|
||||||
sv: 'warezcdn',
|
|
||||||
})}`,
|
|
||||||
},
|
|
||||||
query: {
|
|
||||||
id: ctx.url,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const allowanceKey = page.match(/let allowanceKey = "(.*?)";/)?.[1];
|
|
||||||
if (!allowanceKey) throw new NotFoundError('Failed to get allowanceKey');
|
|
||||||
|
|
||||||
const streamData = await ctx.proxiedFetcher<string>('/functions.php', {
|
|
||||||
baseUrl: warezcdnPlayerBase,
|
|
||||||
method: 'POST',
|
|
||||||
body: new URLSearchParams({
|
|
||||||
getVideo: ctx.url,
|
|
||||||
key: allowanceKey,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
const stream = JSON.parse(streamData);
|
|
||||||
|
|
||||||
if (!stream.id) throw new NotFoundError("can't get stream id");
|
|
||||||
|
|
||||||
const decryptedId = decrypt(stream.id);
|
|
||||||
|
|
||||||
if (!decryptedId) throw new NotFoundError("can't get file id");
|
|
||||||
|
|
||||||
return decryptedId;
|
|
||||||
}
|
|
@@ -1,44 +0,0 @@
|
|||||||
import { flags } from '@/entrypoint/utils/targets';
|
|
||||||
import { makeEmbed } from '@/providers/base';
|
|
||||||
import { EmbedScrapeContext } from '@/utils/context';
|
|
||||||
import { NotFoundError } from '@/utils/errors';
|
|
||||||
|
|
||||||
import { getDecryptedId } from './common';
|
|
||||||
|
|
||||||
// Method found by atpn
|
|
||||||
async function getVideowlUrlStream(ctx: EmbedScrapeContext, decryptedId: string) {
|
|
||||||
const sharePage = await ctx.proxiedFetcher<string>('https://cloud.mail.ru/public/uaRH/2PYWcJRpH');
|
|
||||||
const regex = /"videowl_view":\{"count":"(\d+)","url":"([^"]+)"\}/g;
|
|
||||||
const videowlUrl = regex.exec(sharePage)?.[2];
|
|
||||||
|
|
||||||
if (!videowlUrl) throw new NotFoundError('Failed to get videoOwlUrl');
|
|
||||||
|
|
||||||
return `${videowlUrl}/0p/${btoa(decryptedId)}.m3u8?${new URLSearchParams({
|
|
||||||
double_encode: '1',
|
|
||||||
})}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const warezcdnembedHlsScraper = makeEmbed({
|
|
||||||
id: 'warezcdnembedhls', // WarezCDN is both a source and an embed host
|
|
||||||
name: 'WarezCDN HLS',
|
|
||||||
rank: 83,
|
|
||||||
async scrape(ctx) {
|
|
||||||
const decryptedId = await getDecryptedId(ctx);
|
|
||||||
|
|
||||||
if (!decryptedId) throw new NotFoundError("can't get file id");
|
|
||||||
|
|
||||||
const streamUrl = await getVideowlUrlStream(ctx, decryptedId);
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
type: 'hls',
|
|
||||||
flags: [flags.IP_LOCKED],
|
|
||||||
captions: [],
|
|
||||||
playlist: streamUrl,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
@@ -1,58 +0,0 @@
|
|||||||
import { flags } from '@/entrypoint/utils/targets';
|
|
||||||
import { makeEmbed } from '@/providers/base';
|
|
||||||
import { warezcdnWorkerProxy } from '@/providers/sources/warezcdn/common';
|
|
||||||
import { EmbedScrapeContext } from '@/utils/context';
|
|
||||||
import { NotFoundError } from '@/utils/errors';
|
|
||||||
|
|
||||||
import { getDecryptedId } from './common';
|
|
||||||
|
|
||||||
const cdnListing = [50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64];
|
|
||||||
|
|
||||||
async function checkUrls(ctx: EmbedScrapeContext, fileId: string) {
|
|
||||||
for (const id of cdnListing) {
|
|
||||||
const url = `https://cloclo${id}.cloud.mail.ru/weblink/view/${fileId}`;
|
|
||||||
const response = await ctx.proxiedFetcher.full(url, {
|
|
||||||
method: 'GET',
|
|
||||||
headers: {
|
|
||||||
Range: 'bytes=0-1',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
if (response.statusCode === 206) return url;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const warezcdnembedMp4Scraper = makeEmbed({
|
|
||||||
id: 'warezcdnembedmp4', // WarezCDN is both a source and an embed host
|
|
||||||
name: 'WarezCDN MP4',
|
|
||||||
rank: 82,
|
|
||||||
disabled: false,
|
|
||||||
async scrape(ctx) {
|
|
||||||
const decryptedId = await getDecryptedId(ctx);
|
|
||||||
|
|
||||||
if (!decryptedId) throw new NotFoundError("can't get file id");
|
|
||||||
|
|
||||||
const streamUrl = await checkUrls(ctx, decryptedId);
|
|
||||||
|
|
||||||
if (!streamUrl) throw new NotFoundError("can't get stream id");
|
|
||||||
|
|
||||||
return {
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
captions: [],
|
|
||||||
qualities: {
|
|
||||||
unknown: {
|
|
||||||
type: 'mp4',
|
|
||||||
url: `${warezcdnWorkerProxy}/?${new URLSearchParams({
|
|
||||||
url: streamUrl,
|
|
||||||
})}`,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
type: 'file',
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
@@ -1,30 +1,30 @@
|
|||||||
export interface Subtitle {
|
export interface Episode {
|
||||||
url: string;
|
episode: string;
|
||||||
name: string;
|
id: number;
|
||||||
|
videoKey: string;
|
||||||
|
hls: string;
|
||||||
|
audio: {
|
||||||
|
names: string[];
|
||||||
|
order: number[];
|
||||||
|
}
|
||||||
|
cc: Subtitle[];
|
||||||
|
duration: number;
|
||||||
|
title: string;
|
||||||
|
download: string;
|
||||||
|
sections: string[]
|
||||||
|
poster: string;
|
||||||
|
preview: {
|
||||||
|
src: string;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Episode {
|
export interface Subtitle {
|
||||||
episode: string;
|
url: string;
|
||||||
id: number;
|
name: string;
|
||||||
videoKey: string;
|
|
||||||
hls: string;
|
|
||||||
audio: {
|
|
||||||
names: string[];
|
|
||||||
order: number[];
|
|
||||||
};
|
|
||||||
cc: Subtitle[];
|
|
||||||
duration: number;
|
|
||||||
title: string;
|
|
||||||
download: string;
|
|
||||||
sections: string[];
|
|
||||||
poster: string;
|
|
||||||
preview: {
|
|
||||||
src: string;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Season {
|
export interface Season {
|
||||||
season: number;
|
season: number,
|
||||||
blocked: boolean;
|
blocked: boolean,
|
||||||
episodes: Episode[];
|
episodes: Episode[]
|
||||||
}
|
}
|
@@ -1,120 +0,0 @@
|
|||||||
import { load } from 'cheerio';
|
|
||||||
|
|
||||||
import { flags } from '@/entrypoint/utils/targets';
|
|
||||||
import { Caption, labelToLanguageCode } from '@/providers/captions';
|
|
||||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
|
||||||
import { NotFoundError } from '@/utils/errors';
|
|
||||||
|
|
||||||
import { InfoResponse } from './types';
|
|
||||||
import { SourcererOutput, makeSourcerer } from '../../base';
|
|
||||||
|
|
||||||
const baseUrl = 'https://soaper.tv';
|
|
||||||
|
|
||||||
const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Promise<SourcererOutput> => {
|
|
||||||
const searchResult = await ctx.proxiedFetcher('/search.html', {
|
|
||||||
baseUrl,
|
|
||||||
query: {
|
|
||||||
keyword: ctx.media.title,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const searchResult$ = load(searchResult);
|
|
||||||
let showLink = searchResult$('a')
|
|
||||||
.filter((_, el) => searchResult$(el).text() === ctx.media.title)
|
|
||||||
.attr('href');
|
|
||||||
if (!showLink) throw new NotFoundError('Content not found');
|
|
||||||
|
|
||||||
if (ctx.media.type === 'show') {
|
|
||||||
const seasonNumber = ctx.media.season.number;
|
|
||||||
const episodeNumber = ctx.media.episode.number;
|
|
||||||
const showPage = await ctx.proxiedFetcher(showLink, { baseUrl });
|
|
||||||
const showPage$ = load(showPage);
|
|
||||||
const seasonBlock = showPage$('h4')
|
|
||||||
.filter((_, el) => showPage$(el).text().trim().split(':')[0].trim() === `Season${seasonNumber}`)
|
|
||||||
.parent();
|
|
||||||
const episodes = seasonBlock.find('a').toArray();
|
|
||||||
showLink = showPage$(
|
|
||||||
episodes.find((el) => parseInt(showPage$(el).text().split('.')[0], 10) === episodeNumber),
|
|
||||||
).attr('href');
|
|
||||||
}
|
|
||||||
if (!showLink) throw new NotFoundError('Content not found');
|
|
||||||
const contentPage = await ctx.proxiedFetcher(showLink, { baseUrl });
|
|
||||||
const contentPage$ = load(contentPage);
|
|
||||||
|
|
||||||
const pass = contentPage$('#hId').attr('value');
|
|
||||||
const param = contentPage$('#divU').text();
|
|
||||||
|
|
||||||
if (!pass || !param) throw new NotFoundError('Content not found');
|
|
||||||
|
|
||||||
const formData = new URLSearchParams();
|
|
||||||
formData.append('pass', pass);
|
|
||||||
formData.append('param', param);
|
|
||||||
formData.append('e2', '0');
|
|
||||||
formData.append('server', '0');
|
|
||||||
|
|
||||||
const infoEndpoint = ctx.media.type === 'show' ? '/home/index/getEInfoAjax' : '/home/index/getMInfoAjax';
|
|
||||||
const streamRes = await ctx.proxiedFetcher<string>(infoEndpoint, {
|
|
||||||
baseUrl,
|
|
||||||
method: 'POST',
|
|
||||||
body: formData,
|
|
||||||
headers: {
|
|
||||||
referer: `${baseUrl}${showLink}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const streamResJson: InfoResponse = JSON.parse(streamRes);
|
|
||||||
|
|
||||||
const captions: Caption[] = [];
|
|
||||||
for (const sub of streamResJson.subs) {
|
|
||||||
// Some subtitles are named <Language>.srt, some are named <LanguageCode>:hi, or just <LanguageCode>
|
|
||||||
let language: string | null = '';
|
|
||||||
if (sub.name.includes('.srt')) {
|
|
||||||
language = labelToLanguageCode(sub.name.split('.srt')[0]);
|
|
||||||
} else if (sub.name.includes(':')) {
|
|
||||||
language = sub.name.split(':')[0];
|
|
||||||
} else {
|
|
||||||
language = sub.name;
|
|
||||||
}
|
|
||||||
if (!language) continue;
|
|
||||||
|
|
||||||
captions.push({
|
|
||||||
id: sub.path,
|
|
||||||
url: sub.path,
|
|
||||||
type: 'srt',
|
|
||||||
hasCorsRestrictions: false,
|
|
||||||
language,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
embeds: [],
|
|
||||||
stream: [
|
|
||||||
{
|
|
||||||
id: 'primary',
|
|
||||||
playlist: streamResJson.val,
|
|
||||||
type: 'hls',
|
|
||||||
flags: [flags.IP_LOCKED],
|
|
||||||
captions,
|
|
||||||
},
|
|
||||||
...(streamResJson.val_bak
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
id: 'backup',
|
|
||||||
playlist: streamResJson.val_bak,
|
|
||||||
type: 'hls' as const,
|
|
||||||
flags: [flags.IP_LOCKED],
|
|
||||||
captions,
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
],
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export const soaperTvScraper = makeSourcerer({
|
|
||||||
id: 'soapertv',
|
|
||||||
name: 'SoaperTV',
|
|
||||||
rank: 115,
|
|
||||||
flags: [flags.IP_LOCKED],
|
|
||||||
scrapeMovie: universalScraper,
|
|
||||||
scrapeShow: universalScraper,
|
|
||||||
});
|
|
@@ -1,15 +0,0 @@
|
|||||||
export interface Subtitle {
|
|
||||||
path: string;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface InfoResponse {
|
|
||||||
key: boolean;
|
|
||||||
val: string;
|
|
||||||
vtt: string;
|
|
||||||
val_bak: string;
|
|
||||||
pos: number;
|
|
||||||
type: string;
|
|
||||||
subs: Subtitle[];
|
|
||||||
ip: string;
|
|
||||||
}
|
|
@@ -6,7 +6,6 @@ export const vidsrcScraper = makeSourcerer({
|
|||||||
id: 'vidsrc',
|
id: 'vidsrc',
|
||||||
name: 'VidSrc',
|
name: 'VidSrc',
|
||||||
rank: 90,
|
rank: 90,
|
||||||
disabled: true,
|
|
||||||
flags: [],
|
flags: [],
|
||||||
scrapeMovie,
|
scrapeMovie,
|
||||||
scrapeShow,
|
scrapeShow,
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
import { ScrapeContext } from '@/utils/context';
|
|
||||||
|
|
||||||
export const warezcdnBase = 'https://embed.warezcdn.com';
|
|
||||||
export const warezcdnApiBase = 'https://warezcdn.com/embed';
|
|
||||||
export const warezcdnPlayerBase = 'https://warezcdn.com/player';
|
|
||||||
export const warezcdnWorkerProxy = 'https://workerproxy.warezcdn.workers.dev';
|
|
||||||
|
|
||||||
export async function getExternalPlayerUrl(ctx: ScrapeContext, embedId: string, embedUrl: string) {
|
|
||||||
const params = {
|
|
||||||
id: embedUrl,
|
|
||||||
sv: embedId,
|
|
||||||
};
|
|
||||||
const realUrl = await ctx.proxiedFetcher<string>(`/getPlay.php`, {
|
|
||||||
baseUrl: warezcdnApiBase,
|
|
||||||
headers: {
|
|
||||||
Referer: `${warezcdnApiBase}/getEmbed.php?${new URLSearchParams(params)}`,
|
|
||||||
},
|
|
||||||
query: params,
|
|
||||||
});
|
|
||||||
|
|
||||||
const realEmbedUrl = realUrl.match(/window\.location\.href="([^"]*)";/);
|
|
||||||
if (!realEmbedUrl) throw new Error('Could not find embed url');
|
|
||||||
return realEmbedUrl[1];
|
|
||||||
}
|
|
@@ -1,114 +0,0 @@
|
|||||||
import { load } from 'cheerio';
|
|
||||||
|
|
||||||
import { flags } from '@/entrypoint/utils/targets';
|
|
||||||
import { SourcererEmbed, makeSourcerer } from '@/providers/base';
|
|
||||||
import { mixdropScraper } from '@/providers/embeds/mixdrop';
|
|
||||||
import { warezcdnembedHlsScraper } from '@/providers/embeds/warezcdn/hls';
|
|
||||||
import { warezcdnembedMp4Scraper } from '@/providers/embeds/warezcdn/mp4';
|
|
||||||
import { NotFoundError } from '@/utils/errors';
|
|
||||||
|
|
||||||
import { getExternalPlayerUrl, warezcdnBase } from './common';
|
|
||||||
import { SerieAjaxResponse } from './types';
|
|
||||||
|
|
||||||
export const warezcdnScraper = makeSourcerer({
|
|
||||||
id: 'warezcdn',
|
|
||||||
name: 'WarezCDN',
|
|
||||||
rank: 81,
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
scrapeMovie: async (ctx) => {
|
|
||||||
if (!ctx.media.imdbId) throw new NotFoundError('This source requires IMDB id.');
|
|
||||||
|
|
||||||
const serversPage = await ctx.proxiedFetcher<string>(`/filme/${ctx.media.imdbId}`, {
|
|
||||||
baseUrl: warezcdnBase,
|
|
||||||
});
|
|
||||||
const $ = load(serversPage);
|
|
||||||
|
|
||||||
const embedsHost = $('.hostList.active [data-load-embed]').get();
|
|
||||||
|
|
||||||
const embeds: SourcererEmbed[] = [];
|
|
||||||
|
|
||||||
embedsHost.forEach(async (element) => {
|
|
||||||
const embedHost = $(element).attr('data-load-embed-host')!;
|
|
||||||
const embedUrl = $(element).attr('data-load-embed')!;
|
|
||||||
|
|
||||||
if (embedHost === 'mixdrop') {
|
|
||||||
const realEmbedUrl = await getExternalPlayerUrl(ctx, 'mixdrop', embedUrl);
|
|
||||||
if (!realEmbedUrl) throw new Error('Could not find embed url');
|
|
||||||
embeds.push({
|
|
||||||
embedId: mixdropScraper.id,
|
|
||||||
url: realEmbedUrl,
|
|
||||||
});
|
|
||||||
} else if (embedHost === 'warezcdn') {
|
|
||||||
embeds.push(
|
|
||||||
{
|
|
||||||
embedId: warezcdnembedHlsScraper.id,
|
|
||||||
url: embedUrl,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
embedId: warezcdnembedMp4Scraper.id,
|
|
||||||
url: embedUrl,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
|
||||||
embeds,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
scrapeShow: async (ctx) => {
|
|
||||||
if (!ctx.media.imdbId) throw new NotFoundError('This source requires IMDB id.');
|
|
||||||
|
|
||||||
const url = `${warezcdnBase}/serie/${ctx.media.imdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`;
|
|
||||||
|
|
||||||
const serversPage = await ctx.proxiedFetcher<string>(url);
|
|
||||||
|
|
||||||
const episodeId = serversPage.match(/\$\('\[data-load-episode-content="(\d+)"\]'\)/)?.[1];
|
|
||||||
|
|
||||||
if (!episodeId) throw new NotFoundError('Failed to find episode id');
|
|
||||||
|
|
||||||
const streamsData = await ctx.proxiedFetcher<string>(`/serieAjax.php`, {
|
|
||||||
method: 'POST',
|
|
||||||
baseUrl: warezcdnBase,
|
|
||||||
body: new URLSearchParams({
|
|
||||||
getAudios: episodeId,
|
|
||||||
}),
|
|
||||||
headers: {
|
|
||||||
Origin: warezcdnBase,
|
|
||||||
Referer: url,
|
|
||||||
'X-Requested-With': 'XMLHttpRequest',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const streams: SerieAjaxResponse = JSON.parse(streamsData);
|
|
||||||
const list = streams.list['0'];
|
|
||||||
const embeds: SourcererEmbed[] = [];
|
|
||||||
|
|
||||||
// 3 means ok
|
|
||||||
if (list.mixdropStatus === '3') {
|
|
||||||
const realEmbedUrl = await getExternalPlayerUrl(ctx, 'mixdrop', list.id);
|
|
||||||
if (!realEmbedUrl) throw new Error('Could not find embed url');
|
|
||||||
embeds.push({
|
|
||||||
embedId: mixdropScraper.id,
|
|
||||||
url: realEmbedUrl,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (list.warezcdnStatus === '3') {
|
|
||||||
embeds.push(
|
|
||||||
{
|
|
||||||
embedId: warezcdnembedHlsScraper.id,
|
|
||||||
url: list.id,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
embedId: warezcdnembedMp4Scraper.id,
|
|
||||||
url: list.id,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
embeds,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
@@ -1,16 +0,0 @@
|
|||||||
interface Data {
|
|
||||||
id: string;
|
|
||||||
audio: string;
|
|
||||||
mixdropStatus: string;
|
|
||||||
fembedStatus: string;
|
|
||||||
streamtapeStatus: string;
|
|
||||||
warezcdnStatus: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
type List = {
|
|
||||||
[key: string]: Data;
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface SerieAjaxResponse {
|
|
||||||
list: List;
|
|
||||||
}
|
|
@@ -71,7 +71,7 @@ export async function scrapeInvidualSource(
|
|||||||
|
|
||||||
// only check for playable streams if there are streams, and if there are no embeds
|
// only check for playable streams if there are streams, and if there are no embeds
|
||||||
if (output.stream && output.stream.length > 0 && output.embeds.length === 0) {
|
if (output.stream && output.stream.length > 0 && output.embeds.length === 0) {
|
||||||
const playableStreams = await validatePlayableStreams(output.stream, ops, sourceScraper.id);
|
const playableStreams = await validatePlayableStreams(output.stream, ops);
|
||||||
if (playableStreams.length === 0) throw new NotFoundError('No playable streams found');
|
if (playableStreams.length === 0) throw new NotFoundError('No playable streams found');
|
||||||
output.stream = playableStreams;
|
output.stream = playableStreams;
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ export async function scrapeIndividualEmbed(
|
|||||||
.filter((stream) => flagsAllowedInFeatures(ops.features, stream.flags));
|
.filter((stream) => flagsAllowedInFeatures(ops.features, stream.flags));
|
||||||
if (output.stream.length === 0) throw new NotFoundError('No streams found');
|
if (output.stream.length === 0) throw new NotFoundError('No streams found');
|
||||||
|
|
||||||
const playableStreams = await validatePlayableStreams(output.stream, ops, embedScraper.id);
|
const playableStreams = await validatePlayableStreams(output.stream, ops);
|
||||||
if (playableStreams.length === 0) throw new NotFoundError('No playable streams found');
|
if (playableStreams.length === 0) throw new NotFoundError('No playable streams found');
|
||||||
output.stream = playableStreams;
|
output.stream = playableStreams;
|
||||||
|
|
||||||
|
@@ -104,7 +104,7 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
|||||||
|
|
||||||
// return stream is there are any
|
// return stream is there are any
|
||||||
if (output.stream?.[0]) {
|
if (output.stream?.[0]) {
|
||||||
const playableStream = await validatePlayableStream(output.stream[0], ops, source.id);
|
const playableStream = await validatePlayableStream(output.stream[0], ops);
|
||||||
if (!playableStream) throw new NotFoundError('No streams found');
|
if (!playableStream) throw new NotFoundError('No streams found');
|
||||||
return {
|
return {
|
||||||
sourceId: source.id,
|
sourceId: source.id,
|
||||||
@@ -151,7 +151,7 @@ export async function runAllProviders(list: ProviderList, ops: ProviderRunnerOpt
|
|||||||
if (embedOutput.stream.length === 0) {
|
if (embedOutput.stream.length === 0) {
|
||||||
throw new NotFoundError('No streams found');
|
throw new NotFoundError('No streams found');
|
||||||
}
|
}
|
||||||
const playableStream = await validatePlayableStream(embedOutput.stream[0], ops, embed.embedId);
|
const playableStream = await validatePlayableStream(embedOutput.stream[0], ops);
|
||||||
if (!playableStream) throw new NotFoundError('No streams found');
|
if (!playableStream) throw new NotFoundError('No streams found');
|
||||||
embedOutput.stream = [playableStream];
|
embedOutput.stream = [playableStream];
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@@ -1,10 +1,7 @@
|
|||||||
import { warezcdnembedMp4Scraper } from '@/providers/embeds/warezcdn/mp4';
|
|
||||||
import { Stream } from '@/providers/streams';
|
import { Stream } from '@/providers/streams';
|
||||||
import { IndividualEmbedRunnerOptions } from '@/runners/individualRunner';
|
import { IndividualEmbedRunnerOptions } from '@/runners/individualRunner';
|
||||||
import { ProviderRunnerOptions } from '@/runners/runner';
|
import { ProviderRunnerOptions } from '@/runners/runner';
|
||||||
|
|
||||||
const SKIP_VALIDATION_CHECK_IDS = [warezcdnembedMp4Scraper.id];
|
|
||||||
|
|
||||||
export function isValidStream(stream: Stream | undefined): boolean {
|
export function isValidStream(stream: Stream | undefined): boolean {
|
||||||
if (!stream) return false;
|
if (!stream) return false;
|
||||||
if (stream.type === 'hls') {
|
if (stream.type === 'hls') {
|
||||||
@@ -24,10 +21,7 @@ export function isValidStream(stream: Stream | undefined): boolean {
|
|||||||
export async function validatePlayableStream(
|
export async function validatePlayableStream(
|
||||||
stream: Stream,
|
stream: Stream,
|
||||||
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
||||||
sourcererId: string,
|
|
||||||
): Promise<Stream | null> {
|
): Promise<Stream | null> {
|
||||||
if (SKIP_VALIDATION_CHECK_IDS.includes(sourcererId)) return stream;
|
|
||||||
|
|
||||||
if (stream.type === 'hls') {
|
if (stream.type === 'hls') {
|
||||||
const result = await ops.proxiedFetcher.full(stream.playlist, {
|
const result = await ops.proxiedFetcher.full(stream.playlist, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@@ -69,11 +63,8 @@ export async function validatePlayableStream(
|
|||||||
export async function validatePlayableStreams(
|
export async function validatePlayableStreams(
|
||||||
streams: Stream[],
|
streams: Stream[],
|
||||||
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
ops: ProviderRunnerOptions | IndividualEmbedRunnerOptions,
|
||||||
sourcererId: string,
|
|
||||||
): Promise<Stream[]> {
|
): Promise<Stream[]> {
|
||||||
if (SKIP_VALIDATION_CHECK_IDS.includes(sourcererId)) return streams;
|
return (await Promise.all(streams.map((stream) => validatePlayableStream(stream, ops)))).filter(
|
||||||
|
|
||||||
return (await Promise.all(streams.map((stream) => validatePlayableStream(stream, ops, sourcererId)))).filter(
|
|
||||||
(v) => v !== null,
|
(v) => v !== null,
|
||||||
) as Stream[];
|
) as Stream[];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user