mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
Compare commits
31 Commits
356286dfaa
...
dev
Author | SHA1 | Date | |
---|---|---|---|
|
7dfd025aad | ||
|
394d740fa0 | ||
|
f34580978b | ||
|
39ce1023c2 | ||
|
4f351d91ed | ||
|
d639c0b0cf | ||
|
3a9c687d56 | ||
|
af22162bfd | ||
|
c8b2ea3e81 | ||
|
423c07cc56 | ||
|
89a78e4ae9 | ||
|
3826b8d887 | ||
|
f0d9ee2944 | ||
|
8de7e61eab | ||
|
95617763d0 | ||
|
0a2259b1f4 | ||
|
79a8fdca6d | ||
|
94bfcd0c31 | ||
|
ef600dd08c | ||
|
025b6821e6 | ||
|
089c6aa6ce | ||
|
cffbc844e0 | ||
|
3f68b00ffa | ||
|
9ba05ab991 | ||
|
c17b74c8ba | ||
|
1a754ad951 | ||
|
51c58aae75 | ||
|
aabfbfbeea | ||
|
0c7aa1756b | ||
|
53fbc3b42d | ||
|
8abc8b96e4 |
@@ -2,6 +2,11 @@
|
|||||||
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.2.9",
|
"version": "2.3.0",
|
||||||
"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",
|
||||||
|
@@ -19,11 +19,14 @@ import { kissAsianScraper } from '@/providers/sources/kissasian/index';
|
|||||||
import { lookmovieScraper } from '@/providers/sources/lookmovie';
|
import { lookmovieScraper } from '@/providers/sources/lookmovie';
|
||||||
import { remotestreamScraper } from '@/providers/sources/remotestream';
|
import { remotestreamScraper } from '@/providers/sources/remotestream';
|
||||||
import { showboxScraper } from '@/providers/sources/showbox/index';
|
import { showboxScraper } from '@/providers/sources/showbox/index';
|
||||||
|
import { tugaflixScraper } from '@/providers/sources/tugaflix';
|
||||||
import { vidsrcScraper } from '@/providers/sources/vidsrc/index';
|
import { vidsrcScraper } from '@/providers/sources/vidsrc/index';
|
||||||
import { zoechipScraper } from '@/providers/sources/zoechip';
|
import { zoechipScraper } from '@/providers/sources/zoechip';
|
||||||
|
|
||||||
|
import { bflixScraper } from './embeds/bflix';
|
||||||
import { closeLoadScraper } from './embeds/closeload';
|
import { closeLoadScraper } from './embeds/closeload';
|
||||||
import { fileMoonScraper } from './embeds/filemoon';
|
import { fileMoonScraper } from './embeds/filemoon';
|
||||||
|
import { fileMoonMp4Scraper } from './embeds/filemoon/mp4';
|
||||||
import { ridooScraper } from './embeds/ridoo';
|
import { ridooScraper } from './embeds/ridoo';
|
||||||
import { smashyStreamOScraper } from './embeds/smashystream/opstream';
|
import { smashyStreamOScraper } from './embeds/smashystream/opstream';
|
||||||
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
||||||
@@ -32,15 +35,19 @@ 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';
|
||||||
import { nepuScraper } from './sources/nepu';
|
import { nepuScraper } from './sources/nepu';
|
||||||
|
import { nitesScraper } from './sources/nites';
|
||||||
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 { 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
|
||||||
@@ -60,8 +67,11 @@ export function gatherAllSources(): Array<Sourcerer> {
|
|||||||
goojaraScraper,
|
goojaraScraper,
|
||||||
hdRezkaScraper,
|
hdRezkaScraper,
|
||||||
primewireScraper,
|
primewireScraper,
|
||||||
|
warezcdnScraper,
|
||||||
insertunitScraper,
|
insertunitScraper,
|
||||||
|
nitesScraper,
|
||||||
soaperTvScraper,
|
soaperTvScraper,
|
||||||
|
tugaflixScraper,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +93,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||||||
ridooScraper,
|
ridooScraper,
|
||||||
closeLoadScraper,
|
closeLoadScraper,
|
||||||
fileMoonScraper,
|
fileMoonScraper,
|
||||||
|
fileMoonMp4Scraper,
|
||||||
vidplayScraper,
|
vidplayScraper,
|
||||||
wootlyScraper,
|
wootlyScraper,
|
||||||
doodScraper,
|
doodScraper,
|
||||||
@@ -92,5 +103,8 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||||||
droploadScraper,
|
droploadScraper,
|
||||||
filelionsScraper,
|
filelionsScraper,
|
||||||
vTubeScraper,
|
vTubeScraper,
|
||||||
|
warezcdnembedHlsScraper,
|
||||||
|
warezcdnembedMp4Scraper,
|
||||||
|
bflixScraper,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
42
src/providers/embeds/bflix.ts
Normal file
42
src/providers/embeds/bflix.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { unpack } from 'unpacker';
|
||||||
|
|
||||||
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
|
||||||
|
const evalCodeRegex = /eval\((.*)\)/g;
|
||||||
|
const mp4Regex = /https?:\/\/.*\.mp4/;
|
||||||
|
|
||||||
|
export const bflixScraper = makeEmbed({
|
||||||
|
id: 'bflix',
|
||||||
|
name: 'bFlix',
|
||||||
|
rank: 113,
|
||||||
|
scrape: async (ctx) => {
|
||||||
|
const mainPage = await ctx.proxiedFetcher<string>(ctx.url);
|
||||||
|
|
||||||
|
const evalCode = mainPage.match(evalCodeRegex);
|
||||||
|
if (!evalCode) throw new Error('Failed to find eval code');
|
||||||
|
const unpacked = unpack(evalCode[0]);
|
||||||
|
|
||||||
|
const file = unpacked.match(mp4Regex);
|
||||||
|
if (!file?.[0]) throw new Error('Failed to find file');
|
||||||
|
|
||||||
|
return {
|
||||||
|
stream: [
|
||||||
|
{
|
||||||
|
id: 'primary',
|
||||||
|
type: 'file',
|
||||||
|
flags: [],
|
||||||
|
captions: [],
|
||||||
|
qualities: {
|
||||||
|
unknown: {
|
||||||
|
type: 'mp4',
|
||||||
|
url: file[0],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Referer: 'https://bflix.gs/',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
@@ -11,7 +11,7 @@ const fileRegex = /file:"(.*?)"/g;
|
|||||||
export const fileMoonScraper = makeEmbed({
|
export const fileMoonScraper = makeEmbed({
|
||||||
id: 'filemoon',
|
id: 'filemoon',
|
||||||
name: 'Filemoon',
|
name: 'Filemoon',
|
||||||
rank: 400,
|
rank: 300,
|
||||||
scrape: async (ctx) => {
|
scrape: async (ctx) => {
|
||||||
const embedRes = await ctx.proxiedFetcher<string>(ctx.url, {
|
const embedRes = await ctx.proxiedFetcher<string>(ctx.url, {
|
||||||
headers: {
|
headers: {
|
||||||
|
37
src/providers/embeds/filemoon/mp4.ts
Normal file
37
src/providers/embeds/filemoon/mp4.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
|
import { makeEmbed } from '../../base';
|
||||||
|
|
||||||
|
import { fileMoonScraper } from './index';
|
||||||
|
|
||||||
|
export const fileMoonMp4Scraper = makeEmbed({
|
||||||
|
id: 'filemoon-mp4',
|
||||||
|
name: 'Filemoon MP4',
|
||||||
|
rank: 400,
|
||||||
|
scrape: async (ctx) => {
|
||||||
|
const result = await fileMoonScraper.scrape(ctx);
|
||||||
|
|
||||||
|
if (!result.stream) throw new NotFoundError('Failed to find result');
|
||||||
|
|
||||||
|
if (result.stream[0].type !== 'hls') throw new NotFoundError('Failed to find hls stream');
|
||||||
|
|
||||||
|
const url = result.stream[0].playlist.replace(/\/hls2\//, '/download/').replace(/\.m3u8/, '.mp4');
|
||||||
|
|
||||||
|
return {
|
||||||
|
stream: [
|
||||||
|
{
|
||||||
|
id: 'primary',
|
||||||
|
type: 'file',
|
||||||
|
qualities: {
|
||||||
|
unknown: {
|
||||||
|
type: 'mp4',
|
||||||
|
url,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
flags: [],
|
||||||
|
captions: result.stream[0].captions,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
58
src/providers/embeds/warezcdn/common.ts
Normal file
58
src/providers/embeds/warezcdn/common.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
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;
|
||||||
|
}
|
44
src/providers/embeds/warezcdn/hls.ts
Normal file
44
src/providers/embeds/warezcdn/hls.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
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,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
58
src/providers/embeds/warezcdn/mp4.ts
Normal file
58
src/providers/embeds/warezcdn/mp4.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
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],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
79
src/providers/sources/nites.ts
Normal file
79
src/providers/sources/nites.ts
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import { load } from 'cheerio';
|
||||||
|
|
||||||
|
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||||
|
import { compareMedia } from '@/utils/compare';
|
||||||
|
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||||
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
|
const baseUrl = 'https://w1.nites.is';
|
||||||
|
|
||||||
|
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||||
|
const searchPage = await ctx.proxiedFetcher('/wp-admin/admin-ajax.php', {
|
||||||
|
baseUrl,
|
||||||
|
method: 'POST',
|
||||||
|
body: new URLSearchParams({
|
||||||
|
action: 'ajax_pagination',
|
||||||
|
query_vars: 'mixed',
|
||||||
|
search: ctx.media.title,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
const $search = load(searchPage);
|
||||||
|
const searchResults: { title: string; year: number; url: string }[] = [];
|
||||||
|
|
||||||
|
$search('li').each((_, element) => {
|
||||||
|
const title = $search(element).find('.entry-title').first().text().trim();
|
||||||
|
const year = parseInt($search(element).find('.year').first().text().trim(), 10);
|
||||||
|
const url = $search(element).find('.lnk-blk').attr('href');
|
||||||
|
if (!title || !year || !url) return;
|
||||||
|
|
||||||
|
searchResults.push({ title, year, url });
|
||||||
|
});
|
||||||
|
|
||||||
|
let watchPageUrl = searchResults.find((x) => x && compareMedia(ctx.media, x.title, x.year))?.url;
|
||||||
|
if (!watchPageUrl) throw new NotFoundError('No watchable item found');
|
||||||
|
|
||||||
|
if (ctx.media.type === 'show') {
|
||||||
|
const match = watchPageUrl.match(/\/series\/([^/]+)\/?/);
|
||||||
|
if (!match) throw new Error('Failed to parse watch page url');
|
||||||
|
watchPageUrl = watchPageUrl.replace(
|
||||||
|
`/series/${match[1]}`,
|
||||||
|
`/episode/${match[1]}-${ctx.media.season.number}x${ctx.media.episode.number}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const watchPage = load(await ctx.proxiedFetcher(watchPageUrl));
|
||||||
|
|
||||||
|
// it embeds vidsrc when it bflix does not has the stream
|
||||||
|
// i think all shows embed vidsrc, not sure
|
||||||
|
const embedUrl = watchPage('ul.bx-lst li a:contains("- Bflix")')
|
||||||
|
.closest('aside')
|
||||||
|
.next('div.video-options')
|
||||||
|
.find('iframe')
|
||||||
|
.attr('data-lazy-src');
|
||||||
|
|
||||||
|
if (!embedUrl) throw new Error('Failed to find embed url');
|
||||||
|
|
||||||
|
const embedPage = load(await ctx.proxiedFetcher(embedUrl));
|
||||||
|
|
||||||
|
const url = embedPage('iframe').attr('src');
|
||||||
|
if (!url) throw new Error('Failed to find embed url');
|
||||||
|
|
||||||
|
return {
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
embedId: 'bflix',
|
||||||
|
url,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const nitesScraper = makeSourcerer({
|
||||||
|
id: 'nites',
|
||||||
|
name: 'Nites',
|
||||||
|
rank: 90,
|
||||||
|
flags: [],
|
||||||
|
scrapeMovie: comboScraper,
|
||||||
|
scrapeShow: comboScraper,
|
||||||
|
});
|
21
src/providers/sources/tugaflix/common.ts
Normal file
21
src/providers/sources/tugaflix/common.ts
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { load } from 'cheerio';
|
||||||
|
|
||||||
|
export const baseUrl = 'https://tugaflix.best/';
|
||||||
|
|
||||||
|
export function parseSearch(page: string): { title: string; year?: number; url: string }[] {
|
||||||
|
const results: { title: string; year?: number; url: string }[] = [];
|
||||||
|
const $ = load(page);
|
||||||
|
|
||||||
|
$('.items .poster').each((_, element) => {
|
||||||
|
const $link = $(element).find('a');
|
||||||
|
const url = $link.attr('href');
|
||||||
|
// ex title: Home Alone (1990)
|
||||||
|
const [, title, year] = $link.attr('title')?.match(/^(.*?)\s*(?:\((\d{4})\))?\s*$/) || [];
|
||||||
|
if (!title || !url) return;
|
||||||
|
|
||||||
|
// tiles dont always have the year
|
||||||
|
results.push({ title, year: year ? parseInt(year, 10) : undefined, url });
|
||||||
|
});
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
116
src/providers/sources/tugaflix/index.ts
Normal file
116
src/providers/sources/tugaflix/index.ts
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
import { load } from 'cheerio';
|
||||||
|
|
||||||
|
import { flags } from '@/entrypoint/utils/targets';
|
||||||
|
import { SourcererEmbed, makeSourcerer } from '@/providers/base';
|
||||||
|
import { compareMedia } from '@/utils/compare';
|
||||||
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
|
import { baseUrl, parseSearch } from './common';
|
||||||
|
|
||||||
|
export const tugaflixScraper = makeSourcerer({
|
||||||
|
id: 'tugaflix',
|
||||||
|
name: 'Tugaflix',
|
||||||
|
rank: 73,
|
||||||
|
flags: [flags.IP_LOCKED],
|
||||||
|
scrapeMovie: async (ctx) => {
|
||||||
|
const searchResults = parseSearch(
|
||||||
|
await ctx.proxiedFetcher<string>('/filmes/', {
|
||||||
|
baseUrl,
|
||||||
|
query: {
|
||||||
|
s: ctx.media.title,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
if (searchResults.length === 0) throw new NotFoundError('No watchable item found');
|
||||||
|
|
||||||
|
const url = searchResults.find((x) => x && compareMedia(ctx.media, x.title, x.year))?.url;
|
||||||
|
if (!url) throw new NotFoundError('No watchable item found');
|
||||||
|
|
||||||
|
const videoPage = await ctx.proxiedFetcher<string>(url, {
|
||||||
|
method: 'POST',
|
||||||
|
body: new URLSearchParams({ play: '' }),
|
||||||
|
});
|
||||||
|
const $ = load(videoPage);
|
||||||
|
|
||||||
|
const embeds: SourcererEmbed[] = [];
|
||||||
|
|
||||||
|
for (const element of $('.play a')) {
|
||||||
|
const embedUrl = $(element).attr('href');
|
||||||
|
if (!embedUrl) continue;
|
||||||
|
|
||||||
|
const embedPage = await ctx.proxiedFetcher.full(
|
||||||
|
embedUrl.startsWith('https://') ? embedUrl : `https://${embedUrl}`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const finalUrl = load(embedPage.body)('a:contains("Download Filme")').attr('href');
|
||||||
|
if (!finalUrl) continue;
|
||||||
|
|
||||||
|
if (finalUrl.includes('streamtape')) {
|
||||||
|
embeds.push({
|
||||||
|
embedId: 'streamtape',
|
||||||
|
url: finalUrl,
|
||||||
|
});
|
||||||
|
// found doodstream on a few shows, maybe movies use it too?
|
||||||
|
// the player 2 is just streamtape in a custom player
|
||||||
|
} else if (finalUrl.includes('dood')) {
|
||||||
|
embeds.push({
|
||||||
|
embedId: 'dood',
|
||||||
|
url: finalUrl,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
embeds,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
scrapeShow: async (ctx) => {
|
||||||
|
const searchResults = parseSearch(
|
||||||
|
await ctx.proxiedFetcher<string>('/series/', {
|
||||||
|
baseUrl,
|
||||||
|
query: {
|
||||||
|
s: ctx.media.title,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
if (searchResults.length === 0) throw new NotFoundError('No watchable item found');
|
||||||
|
|
||||||
|
const url = searchResults.find((x) => x && compareMedia(ctx.media, x.title, x.year))?.url;
|
||||||
|
if (!url) throw new NotFoundError('No watchable item found');
|
||||||
|
|
||||||
|
const s = ctx.media.season.number < 10 ? `0${ctx.media.season.number}` : ctx.media.season.number.toString();
|
||||||
|
const e = ctx.media.episode.number < 10 ? `0${ctx.media.episode.number}` : ctx.media.episode.number.toString();
|
||||||
|
const videoPage = await ctx.proxiedFetcher(url, {
|
||||||
|
method: 'POST',
|
||||||
|
body: new URLSearchParams({ [`S${s}E${e}`]: '' }),
|
||||||
|
});
|
||||||
|
|
||||||
|
const embedUrl = load(videoPage)('iframe[name="player"]').attr('src');
|
||||||
|
if (!embedUrl) throw new Error('Failed to find iframe');
|
||||||
|
|
||||||
|
const playerPage = await ctx.proxiedFetcher(embedUrl.startsWith('https:') ? embedUrl : `https:${embedUrl}`, {
|
||||||
|
method: 'POST',
|
||||||
|
body: new URLSearchParams({ submit: '' }),
|
||||||
|
});
|
||||||
|
|
||||||
|
const embeds: SourcererEmbed[] = [];
|
||||||
|
|
||||||
|
const finalUrl = load(playerPage)('a:contains("Download Episodio")').attr('href');
|
||||||
|
|
||||||
|
if (finalUrl?.includes('streamtape')) {
|
||||||
|
embeds.push({
|
||||||
|
embedId: 'streamtape',
|
||||||
|
url: finalUrl,
|
||||||
|
});
|
||||||
|
} else if (finalUrl?.includes('dood')) {
|
||||||
|
embeds.push({
|
||||||
|
embedId: 'dood',
|
||||||
|
url: finalUrl,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
embeds,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
@@ -6,6 +6,7 @@ export const vidsrcScraper = makeSourcerer({
|
|||||||
id: 'vidsrc',
|
id: 'vidsrc',
|
||||||
name: 'VidSrc',
|
name: 'VidSrc',
|
||||||
rank: 90,
|
rank: 90,
|
||||||
|
disabled: true,
|
||||||
flags: [],
|
flags: [],
|
||||||
scrapeMovie,
|
scrapeMovie,
|
||||||
scrapeShow,
|
scrapeShow,
|
||||||
|
@@ -60,10 +60,16 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr
|
|||||||
const urlWithSubtitles = embedArr.find((v) => v.source === 'Vidplay' && v.url.includes('sub.info'))?.url;
|
const urlWithSubtitles = embedArr.find((v) => v.source === 'Vidplay' && v.url.includes('sub.info'))?.url;
|
||||||
const subtitleUrl = urlWithSubtitles ? new URL(urlWithSubtitles).searchParams.get('sub.info') : null;
|
const subtitleUrl = urlWithSubtitles ? new URL(urlWithSubtitles).searchParams.get('sub.info') : null;
|
||||||
if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl);
|
if (subtitleUrl) fullUrl.searchParams.set('sub.info', subtitleUrl);
|
||||||
embeds.push({
|
embeds.push(
|
||||||
embedId: 'filemoon',
|
{
|
||||||
url: fullUrl.toString(),
|
embedId: 'filemoon',
|
||||||
});
|
url: fullUrl.toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
embedId: 'filemoon-mp4',
|
||||||
|
url: fullUrl.toString(),
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
24
src/providers/sources/warezcdn/common.ts
Normal file
24
src/providers/sources/warezcdn/common.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
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];
|
||||||
|
}
|
114
src/providers/sources/warezcdn/index.ts
Normal file
114
src/providers/sources/warezcdn/index.ts
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
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,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
16
src/providers/sources/warezcdn/types.ts
Normal file
16
src/providers/sources/warezcdn/types.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
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);
|
const playableStreams = await validatePlayableStreams(output.stream, ops, sourceScraper.id);
|
||||||
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);
|
const playableStreams = await validatePlayableStreams(output.stream, ops, embedScraper.id);
|
||||||
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);
|
const playableStream = await validatePlayableStream(output.stream[0], ops, source.id);
|
||||||
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);
|
const playableStream = await validatePlayableStream(embedOutput.stream[0], ops, embed.embedId);
|
||||||
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,7 +1,10 @@
|
|||||||
|
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') {
|
||||||
@@ -21,7 +24,10 @@ 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',
|
||||||
@@ -63,8 +69,11 @@ 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[]> {
|
||||||
return (await Promise.all(streams.map((stream) => validatePlayableStream(stream, ops)))).filter(
|
if (SKIP_VALIDATION_CHECK_IDS.includes(sourcererId)) return streams;
|
||||||
|
|
||||||
|
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