mirror of
https://github.com/p-stream/providers.git
synced 2026-05-20 22:32:05 +00:00
fix vidnest
This commit is contained in:
parent
1415f3bd90
commit
8917961a41
3 changed files with 3 additions and 9 deletions
|
|
@ -91,7 +91,7 @@ import { streamboxScraper } from './sources/streambox';
|
||||||
import { turbovidSourceScraper } from './sources/turbovid';
|
import { turbovidSourceScraper } from './sources/turbovid';
|
||||||
import { vidapiClickScraper } from './sources/vidapiclick';
|
import { vidapiClickScraper } from './sources/vidapiclick';
|
||||||
import { vidifyScraper } from './sources/vidify';
|
import { vidifyScraper } from './sources/vidify';
|
||||||
import vidnestScraper from './sources/vidnest';
|
import { vidnestScraper } from './sources/vidnest';
|
||||||
import { warezcdnScraper } from './sources/warezcdn';
|
import { warezcdnScraper } from './sources/warezcdn';
|
||||||
import { wecimaScraper } from './sources/wecima';
|
import { wecimaScraper } from './sources/wecima';
|
||||||
import { zunimeScraper } from './sources/zunime';
|
import { zunimeScraper } from './sources/zunime';
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,18 @@ 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';
|
||||||
|
|
||||||
const PASSPHRASE = 'T8c8PQlSQVU4mBuW4CbE/g57VBbM5009QHd+ym93aZZ5pEeVpToY6OdpYPvRMVYp';
|
const PASSPHRASE = 'A7kP9mQeXU2BWcD4fRZV+Sg8yN0/M5tLbC1HJQwYe6pOKFaE3vTnPZsRuYdVmLq2';
|
||||||
|
|
||||||
async function decryptVidnestData(encryptedBase64: string): Promise<any> {
|
async function decryptVidnestData(encryptedBase64: string): Promise<any> {
|
||||||
// Decode base64 to get encrypted bytes
|
|
||||||
const encryptedBytes = Uint8Array.from(atob(encryptedBase64), (c) => c.charCodeAt(0));
|
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 iv = encryptedBytes.slice(0, 12);
|
||||||
const ciphertext = encryptedBytes.slice(12, -16);
|
const ciphertext = encryptedBytes.slice(12, -16);
|
||||||
const tag = encryptedBytes.slice(-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 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']);
|
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]);
|
const encrypted = new Uint8Array([...ciphertext, ...tag]);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ async function scrape(ctx: MovieScrapeContext | ShowScrapeContext, type: 'movie'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const vidnestScraper = makeSourcerer({
|
export const vidnestScraper = makeSourcerer({
|
||||||
id: 'vidnest',
|
id: 'vidnest',
|
||||||
name: 'Vidnest',
|
name: 'Vidnest',
|
||||||
rank: 115,
|
rank: 115,
|
||||||
|
|
@ -36,5 +36,3 @@ const vidnestScraper = makeSourcerer({
|
||||||
scrapeMovie: (ctx: MovieScrapeContext) => scrape(ctx, 'movie'),
|
scrapeMovie: (ctx: MovieScrapeContext) => scrape(ctx, 'movie'),
|
||||||
scrapeShow: (ctx: ShowScrapeContext) => scrape(ctx, 'tv'),
|
scrapeShow: (ctx: ShowScrapeContext) => scrape(ctx, 'tv'),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default vidnestScraper;
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue