clean up embeds

This commit is contained in:
Pas 2025-12-16 10:56:16 -07:00
parent bf073be73e
commit 638d6ed996
5 changed files with 2 additions and 255 deletions

View file

@ -29,7 +29,6 @@ import { cinemaosEmbeds } from './embeds/cinemaos';
import { closeLoadScraper } from './embeds/closeload';
import { droploadScraper } from './embeds/dropload';
import { filelionsScraper } from './embeds/filelions';
import { madplayBaseEmbed, madplayNsapiEmbed, madplayNsapiVidFastEmbed, madplayRoperEmbed } from './embeds/madplay';
import { mp4hydraServer1Scraper, mp4hydraServer2Scraper } from './embeds/mp4hydra';
import { myanimedubScraper } from './embeds/myanimedub';
import { myanimesubScraper } from './embeds/myanimesub';
@ -84,7 +83,6 @@ import { embedsuScraper } from './sources/embedsu';
import { fullhdfilmizleScraper } from './sources/fullhdfilmizle';
import { hdRezkaScraper } from './sources/hdrezka';
import { lookmovieScraper } from './sources/lookmovie';
import { madplayScraper } from './sources/madplay';
import { movies4fScraper } from './sources/movies4f';
import { myanimeScraper } from './sources/myanime';
import { nunflixScraper } from './sources/nunflix';
@ -132,7 +130,6 @@ export function gatherAllSources(): Array<Sourcerer> {
animeflvScraper,
pirxcyScraper,
vidsrcvipScraper,
madplayScraper,
rgshowsScraper,
vidifyScraper,
zunimeScraper,
@ -198,10 +195,6 @@ export function gatherAllEmbeds(): Array<Embed> {
// vidsrcNovaEmbed,
// vidsrcCometEmbed,
// vidsrcPulsarEmbed,
madplayBaseEmbed,
madplayNsapiEmbed,
madplayRoperEmbed,
madplayNsapiVidFastEmbed,
...vidifyEmbeds,
...zunimeEmbeds,
...AnimetsuEmbeds,

View file

@ -17,7 +17,7 @@ const headers = {
export function makeAnimetsuEmbed(id: string, rank: number = 100) {
return makeEmbed({
id: `animetsu-${id}`,
name: `${id.charAt(0).toUpperCase() + id.slice(1)}`,
name: `Animetsu ${id.charAt(0).toUpperCase() + id.slice(1)}`,
rank,
flags: [],
async scrape(ctx): Promise<EmbedOutput> {

View file

@ -1,198 +0,0 @@
/* eslint-disable no-console */
import { flags } from '@/entrypoint/utils/targets';
import { NotFoundError } from '@/utils/errors';
import { createM3U8ProxyUrl } from '@/utils/proxy';
import { EmbedOutput, makeEmbed } from '../base';
const baseUrl = 'madplay.site';
const headers = {
referer: 'https://madplay.site/',
origin: 'https://madplay.site',
'User-Agent':
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
};
export const madplayBaseEmbed = makeEmbed({
id: 'madplay-base',
name: 'Base',
rank: 134,
flags: [flags.CORS_ALLOWED],
async scrape(ctx): Promise<EmbedOutput> {
const query = JSON.parse(ctx.url);
const { type, tmdbId, season, episode } = query;
let url = `https://${baseUrl}/api/playsrc`;
if (type === 'movie') {
url += `?id=${tmdbId}`;
} else if (type === 'show') {
url += `?id=${tmdbId}&season=${season}&episode=${episode}`;
}
const res = await ctx.proxiedFetcher(url, { headers });
console.log(res);
if (!Array.isArray(res) || res.length === 0) {
throw new NotFoundError('No streams found');
}
const stream = res[0];
if (!stream.file) {
throw new NotFoundError('No file URL found in stream');
}
ctx.progress(100);
return {
stream: [
{
id: 'primary',
type: 'hls',
playlist: createM3U8ProxyUrl(stream.file, ctx.features, headers),
headers,
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});
export const madplayNsapiEmbed = makeEmbed({
id: 'madplay-nsapi',
name: 'Northstar',
rank: 133,
flags: [flags.CORS_ALLOWED],
async scrape(ctx): Promise<EmbedOutput> {
const query = JSON.parse(ctx.url);
const { type, tmdbId, season, episode } = query;
let url = `https://${baseUrl}/api/nsapi/vid`;
if (type === 'movie') {
url += `?id=${tmdbId}`;
} else if (type === 'show') {
url += `?id=${tmdbId}&season=${season}&episode=${episode}`;
}
const res = await ctx.proxiedFetcher(url, { headers });
console.log(res);
if (!Array.isArray(res) || res.length === 0) {
throw new NotFoundError('No streams found');
}
const stream = res[0];
if (!stream.url) {
throw new NotFoundError('No file URL found in stream');
}
ctx.progress(100);
return {
stream: [
{
id: 'primary',
type: 'hls',
playlist: createM3U8ProxyUrl(stream.url, ctx.features, stream.headers || headers),
headers: stream.headers || headers,
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});
export const madplayRoperEmbed = makeEmbed({
id: 'madplay-roper',
name: 'Roper',
rank: 132,
flags: [flags.CORS_ALLOWED],
async scrape(ctx): Promise<EmbedOutput> {
const query = JSON.parse(ctx.url);
const { type, tmdbId, season, episode } = query;
let url = `https://${baseUrl}/api/roper/`;
if (type === 'movie') {
url += `?id=${tmdbId}&type=movie`;
} else if (type === 'show') {
url += `?id=${tmdbId}&season=${season}&episode=${episode}&type=series`;
}
const res = await ctx.proxiedFetcher(url, { headers });
console.log(res);
if (!Array.isArray(res) || res.length === 0) {
throw new NotFoundError('No streams found');
}
const stream = res[0];
if (!stream.url) {
throw new NotFoundError('No file URL found in stream');
}
ctx.progress(100);
return {
stream: [
{
id: 'primary',
type: 'hls',
playlist: createM3U8ProxyUrl(stream.url, ctx.features, stream.headers || headers),
headers: stream.headers || headers,
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});
export const madplayNsapiVidFastEmbed = makeEmbed({
id: 'madplay-vidfast',
name: 'Vidfast',
rank: 131,
flags: [flags.CORS_ALLOWED],
async scrape(ctx): Promise<EmbedOutput> {
const query = JSON.parse(ctx.url);
const { type, tmdbId, season, episode } = query;
let url = `https://${baseUrl}/api/nsapi/test?url=https://vidfast.pro/`;
if (type === 'movie') {
url += `/movie/${tmdbId}`;
} else if (type === 'show') {
url += `/tv/${tmdbId}/${season}/${episode}`;
}
const res = await ctx.proxiedFetcher(url, { headers });
console.log(res);
if (!Array.isArray(res) || res.length === 0) {
throw new NotFoundError('No streams found');
}
const stream = res[0];
if (!stream.url) {
throw new NotFoundError('No file URL found in stream');
}
ctx.progress(100);
return {
stream: [
{
id: 'primary',
type: 'hls',
playlist: createM3U8ProxyUrl(stream.url, ctx.features, stream.headers || headers),
headers: stream.headers || headers,
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});

View file

@ -16,7 +16,7 @@ const headers = {
export function makeZunimeEmbed(id: string, rank: number = 100) {
return makeEmbed({
id: `zunime-${id}`,
name: `${id.charAt(0).toUpperCase() + id.slice(1)}`,
name: `Zunime ${id.charAt(0).toUpperCase() + id.slice(1)}`,
rank,
flags: [flags.CORS_ALLOWED],
async scrape(ctx): Promise<EmbedOutput> {

View file

@ -1,48 +0,0 @@
import { flags } from '@/entrypoint/utils/targets';
import { SourcererOutput, makeSourcerer } from '@/providers/base';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
const query = {
type: ctx.media.type,
title: ctx.media.title,
tmdbId: ctx.media.tmdbId,
imdbId: ctx.media.imdbId,
...(ctx.media.type === 'show' && {
season: ctx.media.season.number,
episode: ctx.media.episode.number,
}),
releaseYear: ctx.media.releaseYear,
};
return {
embeds: [
{
embedId: 'madplay-base',
url: JSON.stringify(query),
},
{
embedId: 'madplay-nsapi',
url: JSON.stringify(query),
},
{
embedId: 'madplay-roper',
url: JSON.stringify(query),
},
{
embedId: 'madplay-vidfast',
url: JSON.stringify(query),
},
],
};
}
export const madplayScraper = makeSourcerer({
id: 'madplay',
name: 'Flicky',
rank: 155,
disabled: true,
flags: [flags.CORS_ALLOWED],
scrapeMovie: comboScraper,
scrapeShow: comboScraper,
});