mirror of
https://github.com/sussy-code/providers.git
synced 2026-04-21 08:31:57 +00:00
Added NSBX
This commit is contained in:
parent
7dfd025aad
commit
30511f11e8
3 changed files with 57 additions and 0 deletions
|
|
@ -17,6 +17,7 @@ import { goMoviesScraper } from '@/providers/sources/gomovies/index';
|
||||||
import { insertunitScraper } from '@/providers/sources/insertunit';
|
import { insertunitScraper } from '@/providers/sources/insertunit';
|
||||||
import { kissAsianScraper } from '@/providers/sources/kissasian/index';
|
import { kissAsianScraper } from '@/providers/sources/kissasian/index';
|
||||||
import { lookmovieScraper } from '@/providers/sources/lookmovie';
|
import { lookmovieScraper } from '@/providers/sources/lookmovie';
|
||||||
|
import { nsbxScraper } from '@/providers/sources/nsbx';
|
||||||
import { remotestreamScraper } from '@/providers/sources/remotestream';
|
import { remotestreamScraper } from '@/providers/sources/remotestream';
|
||||||
import { showboxScraper } from '@/providers/sources/showbox/index';
|
import { showboxScraper } from '@/providers/sources/showbox/index';
|
||||||
import { tugaflixScraper } from '@/providers/sources/tugaflix';
|
import { tugaflixScraper } from '@/providers/sources/tugaflix';
|
||||||
|
|
@ -27,6 +28,7 @@ import { bflixScraper } from './embeds/bflix';
|
||||||
import { closeLoadScraper } from './embeds/closeload';
|
import { closeLoadScraper } from './embeds/closeload';
|
||||||
import { fileMoonScraper } from './embeds/filemoon';
|
import { fileMoonScraper } from './embeds/filemoon';
|
||||||
import { fileMoonMp4Scraper } from './embeds/filemoon/mp4';
|
import { fileMoonMp4Scraper } from './embeds/filemoon/mp4';
|
||||||
|
import { deltaScraper } from './embeds/nsbx/delta';
|
||||||
import { ridooScraper } from './embeds/ridoo';
|
import { ridooScraper } from './embeds/ridoo';
|
||||||
import { smashyStreamOScraper } from './embeds/smashystream/opstream';
|
import { smashyStreamOScraper } from './embeds/smashystream/opstream';
|
||||||
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
import { smashyStreamFScraper } from './embeds/smashystream/video1';
|
||||||
|
|
@ -60,6 +62,7 @@ export function gatherAllSources(): Array<Sourcerer> {
|
||||||
zoechipScraper,
|
zoechipScraper,
|
||||||
vidsrcScraper,
|
vidsrcScraper,
|
||||||
lookmovieScraper,
|
lookmovieScraper,
|
||||||
|
nsbxScraper,
|
||||||
smashyStreamScraper,
|
smashyStreamScraper,
|
||||||
ridooMoviesScraper,
|
ridooMoviesScraper,
|
||||||
vidSrcToScraper,
|
vidSrcToScraper,
|
||||||
|
|
@ -94,6 +97,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
||||||
closeLoadScraper,
|
closeLoadScraper,
|
||||||
fileMoonScraper,
|
fileMoonScraper,
|
||||||
fileMoonMp4Scraper,
|
fileMoonMp4Scraper,
|
||||||
|
deltaScraper,
|
||||||
vidplayScraper,
|
vidplayScraper,
|
||||||
wootlyScraper,
|
wootlyScraper,
|
||||||
doodScraper,
|
doodScraper,
|
||||||
|
|
|
||||||
14
src/providers/embeds/nsbx/delta.ts
Normal file
14
src/providers/embeds/nsbx/delta.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
import { EmbedOutput, makeEmbed } from '@/providers/base';
|
||||||
|
|
||||||
|
export const deltaScraper = makeEmbed({
|
||||||
|
id: 'delta',
|
||||||
|
name: 'Delta',
|
||||||
|
rank: 200,
|
||||||
|
disabled: false,
|
||||||
|
async scrape(ctx) {
|
||||||
|
const url = `https://api.nsbx.ru/provider?resourceId=${encodeURIComponent(ctx.url)}&provider=delta`;
|
||||||
|
const result = await ctx.fetcher(url);
|
||||||
|
|
||||||
|
return result as EmbedOutput;
|
||||||
|
},
|
||||||
|
});
|
||||||
39
src/providers/sources/nsbx.ts
Normal file
39
src/providers/sources/nsbx.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import { flags } from '@/entrypoint/utils/targets';
|
||||||
|
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||||
|
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||||
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
|
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||||
|
const query = {
|
||||||
|
title: ctx.media.title,
|
||||||
|
releaseYear: ctx.media.releaseYear,
|
||||||
|
tmdbId: ctx.media.tmdbId,
|
||||||
|
imdbId: ctx.media.imdbId,
|
||||||
|
type: ctx.media.type,
|
||||||
|
season: '',
|
||||||
|
episode: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
if (ctx.media.type === 'show') {
|
||||||
|
query.season = ctx.media.season.number.toString();
|
||||||
|
query.episode = ctx.media.episode.number.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await ctx.fetcher(`https://api.nsbx.ru/search?query=${encodeURIComponent(JSON.stringify(query))}`);
|
||||||
|
|
||||||
|
if (result.embeds.length === 0) throw new NotFoundError('No watchable item found');
|
||||||
|
|
||||||
|
return {
|
||||||
|
embeds: result.embeds as SourcererEmbed[],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const nsbxScraper = makeSourcerer({
|
||||||
|
id: 'nsbx',
|
||||||
|
name: 'NSBX',
|
||||||
|
rank: 150,
|
||||||
|
flags: [flags.CORS_ALLOWED],
|
||||||
|
disabled: false,
|
||||||
|
scrapeMovie: comboScraper,
|
||||||
|
scrapeShow: comboScraper,
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue