mirror of
https://github.com/sussy-code/providers.git
synced 2026-08-19 13:35:56 +00:00
Update nunflix.ts
This commit is contained in:
parent
771f4bc297
commit
76b1e764a5
1 changed files with 15 additions and 4 deletions
|
|
@ -33,11 +33,22 @@ interface StreamData {
|
|||
source: string;
|
||||
}
|
||||
|
||||
const getUserToken = (): string | null => {
|
||||
try {
|
||||
return typeof window !== 'undefined' ? window.localStorage.getItem('febbox_ui_token') : null;
|
||||
} catch (e) {
|
||||
console.warn('Unable to access localStorage:', e);
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
const userToken = getUserToken();
|
||||
|
||||
const apiUrl =
|
||||
ctx.media.type === 'movie'
|
||||
? `${mamaApiBase}/movie/${ctx.media.tmdbId}`
|
||||
: `${mamaApiBase}/tv/${ctx.media.tmdbId}?season=${ctx.media.season.number}&episode=${ctx.media.episode.number}`;
|
||||
? `${mamaApiBase}/movie/${ctx.media.tmdbId}&token=${userToken}`
|
||||
: `${mamaApiBase}/tv/${ctx.media.tmdbId}?season=${ctx.media.season.number}&episode=${ctx.media.episode.number}&token=${userToken}`;
|
||||
|
||||
const apiRes = await ctx.proxiedFetcher(apiUrl);
|
||||
|
||||
|
|
@ -128,8 +139,8 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
|
|||
export const nunflixScraper = makeSourcerer({
|
||||
id: 'nunflix',
|
||||
name: 'NFlix',
|
||||
rank: 125,
|
||||
disabled: false,
|
||||
rank: 155,
|
||||
disabled: !!getUserToken(),
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
scrapeMovie: comboScraper,
|
||||
scrapeShow: comboScraper,
|
||||
|
|
|
|||
Loading…
Reference in a new issue