mirror of
https://github.com/p-stream/providers.git
synced 2026-04-20 19:52:09 +00:00
add xprime streambox
This commit is contained in:
parent
f553a641bc
commit
542410c3dd
4 changed files with 100 additions and 28 deletions
|
|
@ -61,7 +61,7 @@ import { warezcdnembedHlsScraper } from './embeds/warezcdn/hls';
|
|||
import { warezcdnembedMp4Scraper } from './embeds/warezcdn/mp4';
|
||||
import { warezPlayerScraper } from './embeds/warezcdn/warezplayer';
|
||||
import { webtor1080Scraper, webtor480Scraper, webtor4kScraper, webtor720Scraper } from './embeds/webtor';
|
||||
import { xprimeApolloEmbed, xprimeFoxEmbed } from './embeds/xprime';
|
||||
import { xprimeApolloEmbed, xprimeFoxEmbed, xprimeStreamboxEmbed } from './embeds/xprime';
|
||||
import { EightStreamScraper } from './sources/8stream';
|
||||
import { coitusScraper } from './sources/coitus';
|
||||
import { embedsuScraper } from './sources/embedsu';
|
||||
|
|
@ -168,5 +168,6 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||
rivePutafilmeScraper,
|
||||
xprimeFoxEmbed,
|
||||
xprimeApolloEmbed,
|
||||
xprimeStreamboxEmbed,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { NotFoundError } from '@/utils/errors';
|
|||
|
||||
const foxBaseUrl = 'https://xprime.tv/foxtemp';
|
||||
const apolloBaseUrl = 'https://kendrickl-3amar.site';
|
||||
const showboxBaseUrl = 'https://xprime.tv/primebox';
|
||||
|
||||
const languageMap: Record<string, string> = {
|
||||
'chinese - hong kong': 'zh',
|
||||
|
|
@ -30,6 +31,11 @@ const languageMap: Record<string, string> = {
|
|||
'spanish - latin american': 'es',
|
||||
swedish: 'sv',
|
||||
turkish: 'tr',
|
||||
اَلْعَرَبِيَّةُ: 'ar',
|
||||
বাংলা: 'bn',
|
||||
filipino: 'tl',
|
||||
indonesia: 'id',
|
||||
اردو: 'ur',
|
||||
};
|
||||
|
||||
export const xprimeFoxEmbed = makeEmbed({
|
||||
|
|
@ -79,7 +85,7 @@ export const xprimeFoxEmbed = makeEmbed({
|
|||
export const xprimeApolloEmbed = makeEmbed({
|
||||
id: 'xprime-apollo',
|
||||
name: 'Appolo',
|
||||
rank: 241,
|
||||
rank: 242,
|
||||
async scrape(ctx): Promise<EmbedOutput> {
|
||||
const query = JSON.parse(ctx.url);
|
||||
let url = `${apolloBaseUrl}/${query.tmdbId}`;
|
||||
|
|
@ -88,9 +94,7 @@ export const xprimeApolloEmbed = makeEmbed({
|
|||
url += `/${query.season}/${query.episode}`;
|
||||
}
|
||||
|
||||
console.log('Fetching URL:', url);
|
||||
const data = await ctx.fetcher(url);
|
||||
console.log('Response data:', data);
|
||||
|
||||
if (!data) throw new NotFoundError('No response received');
|
||||
if (data.error) throw new NotFoundError(data.error);
|
||||
|
|
@ -118,3 +122,70 @@ export const xprimeApolloEmbed = makeEmbed({
|
|||
};
|
||||
},
|
||||
});
|
||||
|
||||
export const xprimeStreamboxEmbed = makeEmbed({
|
||||
id: 'xprime-streambox',
|
||||
name: 'Streambox',
|
||||
rank: 241,
|
||||
async scrape(ctx): Promise<EmbedOutput> {
|
||||
const query = JSON.parse(ctx.url);
|
||||
let url = showboxBaseUrl;
|
||||
|
||||
if (query.type === 'show') {
|
||||
url += `?id=${query.tmdbId}&season=${query.season}&episode=${query.episode}`;
|
||||
} else {
|
||||
url += `?id=${query.tmdbId}`;
|
||||
}
|
||||
|
||||
const data = await ctx.fetcher(url);
|
||||
|
||||
if (!data) throw new NotFoundError('No response received');
|
||||
if (data.error) throw new NotFoundError(data.error);
|
||||
if (!data.streams) throw new NotFoundError('No streams found in response');
|
||||
|
||||
const captions =
|
||||
data.subtitles?.map((sub: { file: string; label: string }) => ({
|
||||
id: sub.label,
|
||||
url: sub.file,
|
||||
language: languageMap[sub.label.toLowerCase()] || 'unknown',
|
||||
type: 'srt',
|
||||
})) || [];
|
||||
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
captions,
|
||||
qualities: {
|
||||
...(data.streams['1080p'] && {
|
||||
1080: {
|
||||
type: 'mp4',
|
||||
url: data.streams['1080p'],
|
||||
},
|
||||
}),
|
||||
...(data.streams['720p'] && {
|
||||
720: {
|
||||
type: 'mp4',
|
||||
url: data.streams['720p'],
|
||||
},
|
||||
}),
|
||||
...(data.streams['480p'] && {
|
||||
480: {
|
||||
type: 'mp4',
|
||||
url: data.streams['480p'],
|
||||
},
|
||||
}),
|
||||
...(data.streams['360p'] && {
|
||||
360: {
|
||||
type: 'mp4',
|
||||
url: data.streams['360p'],
|
||||
},
|
||||
}),
|
||||
},
|
||||
type: 'file',
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,31 +3,30 @@ import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
|||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
const embeds = [];
|
||||
|
||||
embeds.push({
|
||||
embedId: 'xprime-fox',
|
||||
url: JSON.stringify({
|
||||
type: ctx.media.type,
|
||||
title: ctx.media.title,
|
||||
...(ctx.media.type === 'show' && {
|
||||
season: ctx.media.season.number,
|
||||
episode: ctx.media.episode.number,
|
||||
}),
|
||||
const query = {
|
||||
type: ctx.media.type,
|
||||
title: ctx.media.title,
|
||||
tmdbId: ctx.media.tmdbId,
|
||||
...(ctx.media.type === 'show' && {
|
||||
season: ctx.media.season.number,
|
||||
episode: ctx.media.episode.number,
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
embeds.push({
|
||||
embedId: 'xprime-apollo',
|
||||
url: JSON.stringify({
|
||||
type: ctx.media.type,
|
||||
tmdbId: ctx.media.tmdbId,
|
||||
...(ctx.media.type === 'show' && {
|
||||
season: ctx.media.season.number,
|
||||
episode: ctx.media.episode.number,
|
||||
}),
|
||||
}),
|
||||
});
|
||||
const embeds = [
|
||||
{
|
||||
embedId: 'xprime-fox',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'xprime-apollo',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'xprime-streambox',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
];
|
||||
|
||||
return { embeds };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// import { astraScraper, novaScraper, orionScraper } from '@/providers/embeds/whvx';
|
||||
import { FedAPIPrivateScraper, FedDBScraper } from '@/providers/embeds/fedapi';
|
||||
import { warezcdnembedMp4Scraper } from '@/providers/embeds/warezcdn/mp4';
|
||||
import { xprimeApolloEmbed, xprimeFoxEmbed } from '@/providers/embeds/xprime';
|
||||
import { xprimeApolloEmbed, xprimeFoxEmbed, xprimeStreamboxEmbed } from '@/providers/embeds/xprime';
|
||||
import { embedsuScraper } from '@/providers/sources/embedsu';
|
||||
import { uiraliveScraper } from '@/providers/sources/uiralive';
|
||||
import { Stream } from '@/providers/streams';
|
||||
|
|
@ -22,6 +22,7 @@ const SKIP_VALIDATION_CHECK_IDS = [
|
|||
FedDBScraper.id,
|
||||
xprimeFoxEmbed.id,
|
||||
xprimeApolloEmbed.id,
|
||||
xprimeStreamboxEmbed.id,
|
||||
];
|
||||
|
||||
export function isValidStream(stream: Stream | undefined): boolean {
|
||||
|
|
|
|||
Loading…
Reference in a new issue