mirror of
https://github.com/p-stream/providers.git
synced 2026-03-11 17:55:36 +00:00
delete rive
This commit is contained in:
parent
15d597e2d0
commit
3a0bfa2ad4
5 changed files with 0 additions and 610 deletions
|
|
@ -11,7 +11,6 @@ import { insertunitScraper } from '@/providers/sources/insertunit';
|
|||
import { mp4hydraScraper } from '@/providers/sources/mp4hydra';
|
||||
import { nepuScraper } from '@/providers/sources/nepu';
|
||||
import { pirxcyScraper } from '@/providers/sources/pirxcy';
|
||||
import { rivestreamScraper } from '@/providers/sources/rivestream';
|
||||
import { tugaflixScraper } from '@/providers/sources/tugaflix';
|
||||
import { vidsrcScraper } from '@/providers/sources/vidsrc';
|
||||
import { vidsrcvipScraper } from '@/providers/sources/vidsrcvip';
|
||||
|
|
@ -30,7 +29,6 @@ import { closeLoadScraper } from './embeds/closeload';
|
|||
import { madplayBaseEmbed, madplayNsapiEmbed, madplayNsapiVidFastEmbed, madplayRoperEmbed } from './embeds/madplay';
|
||||
import { mp4hydraServer1Scraper, mp4hydraServer2Scraper } from './embeds/mp4hydra';
|
||||
import { ridooScraper } from './embeds/ridoo';
|
||||
import { rivestreamEmbeds } from './embeds/rivestream';
|
||||
import { streamtapeLatinoScraper, streamtapeScraper } from './embeds/streamtape';
|
||||
import { streamvidScraper } from './embeds/streamvid';
|
||||
import {
|
||||
|
|
@ -120,7 +118,6 @@ export function gatherAllSources(): Array<Sourcerer> {
|
|||
madplayScraper,
|
||||
rgshowsScraper,
|
||||
vidifyScraper,
|
||||
rivestreamScraper,
|
||||
zunimeScraper,
|
||||
animetsuScraper,
|
||||
lookmovieScraper,
|
||||
|
|
@ -178,7 +175,6 @@ export function gatherAllEmbeds(): Array<Embed> {
|
|||
madplayRoperEmbed,
|
||||
madplayNsapiVidFastEmbed,
|
||||
...vidifyEmbeds,
|
||||
...rivestreamEmbeds,
|
||||
...zunimeEmbeds,
|
||||
...AnimetsuEmbeds,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,118 +0,0 @@
|
|||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
|
||||
const providers = [
|
||||
{
|
||||
id: 'rive-guru',
|
||||
rank: 270,
|
||||
name: 'Guru (onionflixr/FlixHQ)',
|
||||
},
|
||||
{
|
||||
id: 'rive-ghost',
|
||||
rank: 269,
|
||||
},
|
||||
{
|
||||
id: 'rive-putafilme',
|
||||
rank: 268,
|
||||
name: 'Putafilme - Multi',
|
||||
},
|
||||
{
|
||||
id: 'rive-nova',
|
||||
rank: 267,
|
||||
},
|
||||
{
|
||||
id: 'rive-asiacloud',
|
||||
rank: 266,
|
||||
},
|
||||
{
|
||||
id: 'rive-hydrax',
|
||||
rank: 265,
|
||||
},
|
||||
{
|
||||
id: 'rive-filmecho',
|
||||
rank: 264,
|
||||
name: 'NfMirror',
|
||||
},
|
||||
{
|
||||
id: 'rive-fastx',
|
||||
rank: 263,
|
||||
},
|
||||
{
|
||||
id: 'rive-g1',
|
||||
rank: 262,
|
||||
},
|
||||
{
|
||||
id: 'rive-g2',
|
||||
rank: 261,
|
||||
},
|
||||
{
|
||||
id: 'rive-ee3',
|
||||
rank: 260,
|
||||
},
|
||||
{
|
||||
id: 'rive-kage',
|
||||
rank: 259,
|
||||
},
|
||||
];
|
||||
|
||||
function embed(provider: { id: string; rank: number; name?: string; disabled?: boolean }) {
|
||||
return makeEmbed({
|
||||
id: provider.id,
|
||||
name:
|
||||
provider.name ||
|
||||
provider.id
|
||||
.split('-')
|
||||
.map((word) => word[0].toUpperCase() + word.slice(1))
|
||||
.join(' '),
|
||||
disabled: provider.disabled,
|
||||
rank: provider.rank,
|
||||
async scrape(ctx) {
|
||||
const isHLS = ctx.url.includes('.m3u8') || ctx.url.includes('hls') || ctx.url.includes('playlist');
|
||||
|
||||
if (isHLS) {
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'hls',
|
||||
playlist: ctx.url,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'file',
|
||||
qualities: {
|
||||
unknown: {
|
||||
type: 'mp4',
|
||||
url: ctx.url,
|
||||
},
|
||||
},
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export const [
|
||||
riveHydraxScraper,
|
||||
riveFastxScraper,
|
||||
riveFilmechoScraper,
|
||||
riveNovaScraper,
|
||||
riveGuruScraper,
|
||||
riveG1Scraper,
|
||||
riveG2Scraper,
|
||||
riveEe3Scraper,
|
||||
riveGhostScraper,
|
||||
rivePutafilmeScraper,
|
||||
riveAsiacloudScraper,
|
||||
riveKageScraper,
|
||||
] = providers.map(embed);
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
import { createM3U8ProxyUrl, updateM3U8ProxyUrl } from '@/utils/proxy';
|
||||
|
||||
const baseUrl = 'https://rivestream.org';
|
||||
|
||||
function generateSecretKey(id: number | string) {
|
||||
const keyArray = [
|
||||
'I',
|
||||
'3LZu',
|
||||
'M2V3',
|
||||
'4EXX',
|
||||
's4',
|
||||
'yRy',
|
||||
'oqMz',
|
||||
'ysE',
|
||||
'RT',
|
||||
'iSI',
|
||||
'zlc',
|
||||
'H',
|
||||
'YNp',
|
||||
'5vR6',
|
||||
'h9S',
|
||||
'R',
|
||||
'jo',
|
||||
'F',
|
||||
'h2',
|
||||
'W8',
|
||||
'i',
|
||||
'sz09',
|
||||
'Xom',
|
||||
'gpU',
|
||||
'q',
|
||||
'6Qvg',
|
||||
'Cu',
|
||||
'5Zaz',
|
||||
'VK',
|
||||
'od',
|
||||
'FGY4',
|
||||
'eu',
|
||||
'D5Q',
|
||||
'smH',
|
||||
'11eq',
|
||||
'QrXs',
|
||||
'3',
|
||||
'L3',
|
||||
'YhlP',
|
||||
'c',
|
||||
'Z',
|
||||
'YT',
|
||||
'bnsy',
|
||||
'5',
|
||||
'fcL',
|
||||
'L22G',
|
||||
'r8',
|
||||
'J',
|
||||
'4',
|
||||
'gnK',
|
||||
];
|
||||
|
||||
// Handle undefined/null input
|
||||
if (typeof id === 'undefined' || id === null) {
|
||||
return 'rive';
|
||||
}
|
||||
|
||||
// Convert to number and calculate array index
|
||||
const numericId = typeof id === 'string' ? parseInt(id, 10) : Number(id);
|
||||
const index = numericId % keyArray.length;
|
||||
|
||||
// Handle NaN cases (invalid number conversion)
|
||||
if (Number.isNaN(index)) {
|
||||
return 'rive';
|
||||
}
|
||||
|
||||
return keyArray[index];
|
||||
}
|
||||
|
||||
function createProxyUrl(originalUrl: string, referer: string): string {
|
||||
const headers = {
|
||||
referer,
|
||||
};
|
||||
return createM3U8ProxyUrl(originalUrl, headers);
|
||||
}
|
||||
|
||||
function processProxiedURL(url: string): string {
|
||||
// Handle orbitproxy URLs
|
||||
if (url.includes('orbitproxy')) {
|
||||
try {
|
||||
const urlParts = url.split(/orbitproxy\.[^/]+\//);
|
||||
if (urlParts.length >= 2) {
|
||||
const encryptedPart = urlParts[1].split('.m3u8')[0];
|
||||
try {
|
||||
const decodedData = Buffer.from(encryptedPart, 'base64').toString('utf-8');
|
||||
const jsonData = JSON.parse(decodedData);
|
||||
const originalUrl = jsonData.u;
|
||||
const referer = jsonData.r || '';
|
||||
|
||||
return createProxyUrl(originalUrl, referer);
|
||||
} catch (jsonError) {
|
||||
console.error('Error decoding/parsing orbitproxy data:', jsonError);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error processing orbitproxy URL:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Handle other proxied URLs
|
||||
if (url.includes('/m3u8-proxy?url=')) {
|
||||
return updateM3U8ProxyUrl(url);
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
async function comboScraper(ctx: MovieScrapeContext | ShowScrapeContext): Promise<SourcererOutput> {
|
||||
const tmdbId = ctx.media.tmdbId;
|
||||
const secret = generateSecretKey(tmdbId);
|
||||
|
||||
const servers = [
|
||||
'hydrax',
|
||||
'fastx',
|
||||
'filmecho',
|
||||
'nova',
|
||||
'guru',
|
||||
'g1',
|
||||
'g2',
|
||||
'ee3',
|
||||
'ghost',
|
||||
'putafilme',
|
||||
'asiacloud',
|
||||
'kage',
|
||||
];
|
||||
|
||||
const route =
|
||||
ctx.media.type === 'show'
|
||||
? `/api/backendfetch?requestID=tvVideoProvider&id=${tmdbId}&season=${ctx.media.season.number}&episode=${ctx.media.episode.number}&secretKey=${secret}&service=`
|
||||
: `/api/backendfetch?requestID=movieVideoProvider&id=${tmdbId}&secretKey=${secret}&service=`;
|
||||
|
||||
ctx.progress(20);
|
||||
|
||||
const embeds: SourcererEmbed[] = [];
|
||||
const processedServers = new Set<string>();
|
||||
|
||||
await Promise.all(
|
||||
servers.map(async (server) => {
|
||||
try {
|
||||
const url = baseUrl + route + server;
|
||||
|
||||
const response = await ctx.proxiedFetcher(url, {
|
||||
headers: {
|
||||
Referer: baseUrl,
|
||||
},
|
||||
});
|
||||
|
||||
const data = typeof response === 'string' ? JSON.parse(response) : response;
|
||||
|
||||
if (!data?.data || !data?.data?.sources?.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
data.data.sources.forEach((source: any) => {
|
||||
const processedUrl = processProxiedURL(source.url);
|
||||
|
||||
const serverKey = `rive-${server}`;
|
||||
|
||||
if (!processedServers.has(serverKey)) {
|
||||
processedServers.add(serverKey);
|
||||
|
||||
embeds.push({
|
||||
embedId: serverKey,
|
||||
url: processedUrl,
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Error fetching Rive ${server}:`, error);
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
ctx.progress(90);
|
||||
|
||||
if (!embeds.length) {
|
||||
throw new NotFoundError('No embeds found from Rive');
|
||||
}
|
||||
|
||||
return {
|
||||
embeds,
|
||||
};
|
||||
}
|
||||
|
||||
export const riveScraper = makeSourcerer({
|
||||
id: 'rive',
|
||||
name: 'Rive',
|
||||
rank: 60,
|
||||
disabled: true,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
scrapeMovie: comboScraper,
|
||||
scrapeShow: comboScraper,
|
||||
});
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
/* eslint-disable no-console */
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
import { EmbedOutput, makeEmbed } from '../base';
|
||||
import { labelToLanguageCode } from '../captions';
|
||||
|
||||
const baseUrl = 'rivestream.org';
|
||||
const headers = {
|
||||
referer: 'https://rivestream.org/',
|
||||
origin: 'https://rivestream.org',
|
||||
'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 function makeRivestreamEmbed(id: string, rank: number = 100) {
|
||||
return makeEmbed({
|
||||
id: `rivestream-${id}`,
|
||||
name: `${id.charAt(0).toUpperCase() + id.slice(1)}`,
|
||||
rank,
|
||||
async scrape(ctx): Promise<EmbedOutput> {
|
||||
const query = JSON.parse(ctx.url);
|
||||
const { type, tmdbId, season, episode } = query;
|
||||
|
||||
let url = `https://${baseUrl}/`;
|
||||
|
||||
if (type === 'movie') {
|
||||
url += `/api/backendfetch?requestID=movieVideoProvider&id=${tmdbId}&service=${id}&secretKey=NTUyOTk2OGE=&proxyMode=undefined`;
|
||||
} else if (type === 'show') {
|
||||
url += `/api/backendfetch?requestID=tvVideoProvider&id=${tmdbId}&season=${season}&episode=${episode}&service=${id}&secretKey=LTJhM2VlMDkz&proxyMode=undefined`;
|
||||
} else {
|
||||
throw new NotFoundError('Unsupported media type');
|
||||
}
|
||||
|
||||
const res = await ctx.proxiedFetcher(url, { headers });
|
||||
console.log('res:', JSON.stringify(res, null, 2));
|
||||
|
||||
if (!res.data || !res.data.sources || !Array.isArray(res.data.sources)) {
|
||||
throw new NotFoundError('No sources found');
|
||||
}
|
||||
|
||||
ctx.progress(50);
|
||||
|
||||
const captions =
|
||||
res.data.captions?.map((caption: any) => ({
|
||||
id: caption.label || 'default',
|
||||
url: caption.file,
|
||||
type: 'srt',
|
||||
language: labelToLanguageCode(caption.label),
|
||||
})) || [];
|
||||
|
||||
const firstSource = res.data.sources[0];
|
||||
if (!firstSource) {
|
||||
throw new NotFoundError('No sources available');
|
||||
}
|
||||
|
||||
if (firstSource.format === 'mp4') {
|
||||
const qualities: Record<string, any> = {};
|
||||
|
||||
for (const source of res.data.sources) {
|
||||
const quality = source.quality;
|
||||
if (quality && source.url) {
|
||||
if (quality === 2160 || quality === '4K') {
|
||||
qualities['4k'] = {
|
||||
type: 'mp4',
|
||||
url: source.url,
|
||||
};
|
||||
} else if (quality === 1080) {
|
||||
qualities[1080] = {
|
||||
type: 'mp4',
|
||||
url: source.url,
|
||||
};
|
||||
} else if (quality === 720) {
|
||||
qualities[720] = {
|
||||
type: 'mp4',
|
||||
url: source.url,
|
||||
};
|
||||
} else if (quality === 480) {
|
||||
qualities[480] = {
|
||||
type: 'mp4',
|
||||
url: source.url,
|
||||
};
|
||||
} else if (quality === 360) {
|
||||
qualities[360] = {
|
||||
type: 'mp4',
|
||||
url: source.url,
|
||||
};
|
||||
} else {
|
||||
// For any other quality, add as unknown
|
||||
qualities.unknown = {
|
||||
type: 'mp4',
|
||||
url: source.url,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
console.log('qualities:', qualities);
|
||||
|
||||
ctx.progress(90);
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'file',
|
||||
qualities,
|
||||
headers,
|
||||
flags: [],
|
||||
captions,
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
ctx.progress(90);
|
||||
return {
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'hls',
|
||||
playlist: firstSource.url,
|
||||
headers,
|
||||
flags: [],
|
||||
captions,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const RIVESTREAM_SERVERS = [
|
||||
'flowcast',
|
||||
'humpy',
|
||||
'loki',
|
||||
'asiacloud',
|
||||
'shadow',
|
||||
'hindicast',
|
||||
'animez',
|
||||
'sapphire',
|
||||
'aqua',
|
||||
'guard',
|
||||
'curve',
|
||||
'hq',
|
||||
'ninja',
|
||||
'alpha',
|
||||
'kaze',
|
||||
'zenesis',
|
||||
'zenith',
|
||||
'ghost',
|
||||
'kinoecho',
|
||||
'ee3',
|
||||
'volt',
|
||||
'putafilme',
|
||||
'ophim',
|
||||
'kage',
|
||||
];
|
||||
|
||||
export const rivestreamEmbeds = RIVESTREAM_SERVERS.map((server, i) => makeRivestreamEmbed(server, 400 - i));
|
||||
|
|
@ -1,127 +0,0 @@
|
|||
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: 'rivestream-flowcast',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-humpy',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-loki',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-asiacloud',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-shadow',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-hindicast',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-animez',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-sapphire',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-aqua',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-guard',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-curve',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-hq',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-ninja',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-alpha',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-kaze',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-zenesis',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-zenith',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-ghost',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-kinoecho',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-ee3',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-volt',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-putafilme',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-ophim',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'rivestream-kage',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export const rivestreamScraper = makeSourcerer({
|
||||
id: 'rivestream',
|
||||
name: 'Rivestream',
|
||||
rank: 134,
|
||||
disabled: false,
|
||||
flags: [],
|
||||
scrapeMovie: comboScraper,
|
||||
scrapeShow: comboScraper,
|
||||
});
|
||||
Loading…
Reference in a new issue