mirror of
https://github.com/p-stream/providers.git
synced 2026-03-11 17:55:36 +00:00
update vidnest
This commit is contained in:
parent
45bb904244
commit
770993e07a
3 changed files with 68 additions and 53 deletions
|
|
@ -45,12 +45,7 @@ import { supervideoScraper } from './embeds/supervideo';
|
||||||
import { vidCloudScraper } from './embeds/vidcloud';
|
import { vidCloudScraper } from './embeds/vidcloud';
|
||||||
import { vidhideEnglishScraper, vidhideLatinoScraper, vidhideSpanishScraper } from './embeds/vidhide';
|
import { vidhideEnglishScraper, vidhideLatinoScraper, vidhideSpanishScraper } from './embeds/vidhide';
|
||||||
import { vidifyEmbeds } from './embeds/vidify';
|
import { vidifyEmbeds } from './embeds/vidify';
|
||||||
import {
|
import { vidnestAllmoviesEmbed, vidnestHollymoviehdEmbed } from './embeds/vidnest';
|
||||||
vidnestAllmoviesEmbed,
|
|
||||||
vidnestFlixhqEmbed,
|
|
||||||
vidnestHollymoviehdEmbed,
|
|
||||||
vidnestOfficialEmbed,
|
|
||||||
} from './embeds/vidnest';
|
|
||||||
import {
|
import {
|
||||||
VidsrcsuServer10Scraper,
|
VidsrcsuServer10Scraper,
|
||||||
VidsrcsuServer11Scraper,
|
VidsrcsuServer11Scraper,
|
||||||
|
|
@ -200,8 +195,6 @@ export function gatherAllEmbeds(): Array<Embed> {
|
||||||
...AnimetsuEmbeds,
|
...AnimetsuEmbeds,
|
||||||
vidnestHollymoviehdEmbed,
|
vidnestHollymoviehdEmbed,
|
||||||
vidnestAllmoviesEmbed,
|
vidnestAllmoviesEmbed,
|
||||||
vidnestFlixhqEmbed,
|
|
||||||
vidnestOfficialEmbed,
|
|
||||||
myanimesubScraper,
|
myanimesubScraper,
|
||||||
myanimedubScraper,
|
myanimedubScraper,
|
||||||
filemoonScraper,
|
filemoonScraper,
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,67 @@ import { flags } from '@/entrypoint/utils/targets';
|
||||||
import { makeEmbed } from '@/providers/base';
|
import { makeEmbed } from '@/providers/base';
|
||||||
import { HlsBasedStream } from '@/providers/streams';
|
import { HlsBasedStream } from '@/providers/streams';
|
||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
import { createM3U8ProxyUrl } from '@/utils/proxy';
|
|
||||||
|
const PASSPHRASE = 'T8c8PQlSQVU4mBuW4CbE/g57VBbM5009QHd+ym93aZZ5pEeVpToY6OdpYPvRMVYp';
|
||||||
|
|
||||||
|
async function decryptVidnestData(encryptedBase64: string): Promise<any> {
|
||||||
|
// Decode base64 to get encrypted bytes
|
||||||
|
const encryptedBytes = Uint8Array.from(atob(encryptedBase64), (c) => c.charCodeAt(0));
|
||||||
|
|
||||||
|
// Extract IV (first 12 bytes), ciphertext (middle), and auth tag (last 16 bytes)
|
||||||
|
const iv = encryptedBytes.slice(0, 12);
|
||||||
|
const ciphertext = encryptedBytes.slice(12, -16);
|
||||||
|
const tag = encryptedBytes.slice(-16);
|
||||||
|
|
||||||
|
// Create key from passphrase (decode base64 first, then take first 32 bytes)
|
||||||
|
const keyData = Uint8Array.from(atob(PASSPHRASE), (c) => c.charCodeAt(0)).slice(0, 32);
|
||||||
|
const key = await crypto.subtle.importKey('raw', keyData, { name: 'AES-GCM' }, false, ['decrypt']);
|
||||||
|
|
||||||
|
// Combine ciphertext and tag for decryption
|
||||||
|
const encrypted = new Uint8Array([...ciphertext, ...tag]);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const decrypted = await crypto.subtle.decrypt({ name: 'AES-GCM', iv }, key, encrypted);
|
||||||
|
|
||||||
|
const decryptedText = new TextDecoder().decode(decrypted);
|
||||||
|
return JSON.parse(decryptedText);
|
||||||
|
} catch (error) {
|
||||||
|
throw new NotFoundError('Failed to decrypt data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export const vidnestHollymoviehdEmbed = makeEmbed({
|
export const vidnestHollymoviehdEmbed = makeEmbed({
|
||||||
id: 'vidnest-hollymoviehd',
|
id: 'vidnest-hollymoviehd',
|
||||||
name: 'HollyMovie',
|
name: 'Vidnest HollyMovie',
|
||||||
rank: 104,
|
rank: 104,
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [],
|
||||||
disabled: true,
|
disabled: false,
|
||||||
async scrape(ctx) {
|
async scrape(ctx) {
|
||||||
const serverStreams = await ctx.proxiedFetcher<any>(ctx.url);
|
const response = await ctx.proxiedFetcher<any>(ctx.url);
|
||||||
if (!serverStreams.success || !serverStreams.sources) throw new NotFoundError('No streams found');
|
if (!response.data) throw new NotFoundError('No encrypted data found');
|
||||||
|
|
||||||
|
const decryptedData = await decryptVidnestData(response.data);
|
||||||
|
if (!decryptedData.success && !decryptedData.sources) throw new NotFoundError('No streams found');
|
||||||
|
|
||||||
|
const sources = decryptedData.sources || decryptedData.streams;
|
||||||
const streams: HlsBasedStream[] = [];
|
const streams: HlsBasedStream[] = [];
|
||||||
for (const source of serverStreams.sources) {
|
|
||||||
if (source.file.includes('pkaystream.cc/pl/')) {
|
const streamHeaders = {
|
||||||
|
Origin: 'https://flashstream.cc',
|
||||||
|
Referer: 'https://flashstream.cc/',
|
||||||
|
'User-Agent':
|
||||||
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const source of sources) {
|
||||||
|
if (source.file && (source.file.includes('pkaystream.cc') || source.file.includes('flashstream.cc'))) {
|
||||||
streams.push({
|
streams.push({
|
||||||
id: `hollymoviehd-${source.label}`,
|
id: `hollymoviehd-${source.label || 'default'}`,
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
playlist: createM3U8ProxyUrl(source.file, ctx.features),
|
playlist: source.file,
|
||||||
headers: {},
|
flags: [],
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
captions: [],
|
captions: [],
|
||||||
|
headers: streamHeaders,
|
||||||
} as HlsBasedStream);
|
} as HlsBasedStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -36,23 +75,28 @@ export const vidnestHollymoviehdEmbed = makeEmbed({
|
||||||
|
|
||||||
export const vidnestAllmoviesEmbed = makeEmbed({
|
export const vidnestAllmoviesEmbed = makeEmbed({
|
||||||
id: 'vidnest-allmovies',
|
id: 'vidnest-allmovies',
|
||||||
name: 'AllMovies (Hindi)',
|
name: 'Vidnest AllMovies (Hindi)',
|
||||||
rank: 103,
|
rank: 103,
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [flags.CORS_ALLOWED],
|
||||||
disabled: true,
|
disabled: false,
|
||||||
async scrape(ctx) {
|
async scrape(ctx) {
|
||||||
const serverStreams = await ctx.proxiedFetcher<any>(ctx.url);
|
const response = await ctx.proxiedFetcher<any>(ctx.url);
|
||||||
if (!serverStreams.streams) throw new NotFoundError('No streams found');
|
if (!response.data) throw new NotFoundError('No encrypted data found');
|
||||||
|
|
||||||
|
const decryptedData = await decryptVidnestData(response.data);
|
||||||
|
if (!decryptedData.success && !decryptedData.streams) throw new NotFoundError('No streams found');
|
||||||
|
|
||||||
|
const sources = decryptedData.sources || decryptedData.streams;
|
||||||
const streams = [];
|
const streams = [];
|
||||||
for (const stream of serverStreams.streams) {
|
|
||||||
|
for (const stream of sources) {
|
||||||
streams.push({
|
streams.push({
|
||||||
id: `allmovies-${stream.language}`,
|
id: `allmovies-${stream.language || 'default'}`,
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
playlist: stream.url,
|
playlist: stream.url || stream.file,
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [flags.CORS_ALLOWED],
|
||||||
captions: [],
|
captions: [],
|
||||||
preferredHeaders: stream.headers,
|
preferredHeaders: stream.headers || {},
|
||||||
} as HlsBasedStream);
|
} as HlsBasedStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -61,25 +105,3 @@ export const vidnestAllmoviesEmbed = makeEmbed({
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const vidnestFlixhqEmbed = makeEmbed({
|
|
||||||
id: 'vidnest-flixhq',
|
|
||||||
name: 'FlixHQ',
|
|
||||||
rank: 102,
|
|
||||||
disabled: true,
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
async scrape() {
|
|
||||||
throw new Error('Not implemented');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const vidnestOfficialEmbed = makeEmbed({
|
|
||||||
id: 'vidnest-official',
|
|
||||||
name: 'Official',
|
|
||||||
rank: 101,
|
|
||||||
disabled: true,
|
|
||||||
flags: [flags.CORS_ALLOWED],
|
|
||||||
async scrape() {
|
|
||||||
throw new Error('Not implemented');
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ import { flags } from '@/entrypoint/utils/targets';
|
||||||
import { makeSourcerer } from '@/providers/base';
|
import { makeSourcerer } from '@/providers/base';
|
||||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||||
|
|
||||||
const backendUrl = 'https://backend.vidnest.fun';
|
const backendUrl = 'https://second.vidnest.fun';
|
||||||
|
|
||||||
const servers = ['hollymoviehd', 'allmovies', 'flixhq', 'official'];
|
const servers = ['hollymoviehd', 'allmovies'];
|
||||||
|
|
||||||
async function scrape(ctx: MovieScrapeContext | ShowScrapeContext, type: 'movie' | 'tv') {
|
async function scrape(ctx: MovieScrapeContext | ShowScrapeContext, type: 'movie' | 'tv') {
|
||||||
const embeds = [];
|
const embeds = [];
|
||||||
|
|
@ -32,7 +32,7 @@ const vidnestScraper = makeSourcerer({
|
||||||
id: 'vidnest',
|
id: 'vidnest',
|
||||||
name: 'Vidnest',
|
name: 'Vidnest',
|
||||||
rank: 130,
|
rank: 130,
|
||||||
disabled: true,
|
disabled: false,
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [flags.CORS_ALLOWED],
|
||||||
scrapeMovie: (ctx: MovieScrapeContext) => scrape(ctx, 'movie'),
|
scrapeMovie: (ctx: MovieScrapeContext) => scrape(ctx, 'movie'),
|
||||||
scrapeShow: (ctx: ShowScrapeContext) => scrape(ctx, 'tv'),
|
scrapeShow: (ctx: ShowScrapeContext) => scrape(ctx, 'tv'),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue