mirror of
https://github.com/sussy-code/providers.git
synced 2026-08-10 17:24:45 +00:00
add vidapi.click source
This commit is contained in:
parent
beffc68b64
commit
f8a6fa60aa
3 changed files with 55 additions and 0 deletions
|
|
@ -97,6 +97,7 @@ import { slidemoviesScraper } from './sources/slidemovies';
|
|||
import { smashyStreamScraper } from './sources/smashystream';
|
||||
import { soaperTvScraper } from './sources/soapertv';
|
||||
import { uiraliveScraper } from './sources/uiralive';
|
||||
import { vidapiClickScraper } from './sources/vidapiclick';
|
||||
import { vidlinkScraper } from './sources/vidlink';
|
||||
import { vidSrcToScraper } from './sources/vidsrcto';
|
||||
import { warezcdnScraper } from './sources/warezcdn';
|
||||
|
|
@ -146,6 +147,7 @@ export function gatherAllSources(): Array<Sourcerer> {
|
|||
iosmirrorScraper,
|
||||
iosmirrorPVScraper,
|
||||
uiraliveScraper,
|
||||
vidapiClickScraper,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable no-console */
|
||||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
|
|
@ -25,6 +26,8 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
|
|||
},
|
||||
});
|
||||
|
||||
console.log(data);
|
||||
|
||||
if (!data) throw new NotFoundError('Failed to fetch video source');
|
||||
if (!data.videoSource) throw new NotFoundError('No video source found');
|
||||
ctx.progress(50);
|
||||
|
|
|
|||
50
src/providers/sources/vidapiclick.ts
Normal file
50
src/providers/sources/vidapiclick.ts
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* eslint-disable no-console */
|
||||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
const baseUrl = 'https://vidapi.click';
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
const apiUrl =
|
||||
ctx.media.type === 'show'
|
||||
? `${baseUrl}/api/video/tv/${ctx.media.tmdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`
|
||||
: `${baseUrl}/api/video/movie/${ctx.media.tmdbId}`;
|
||||
|
||||
const apiRes = await ctx.proxiedFetcher(apiUrl, {
|
||||
headers: {
|
||||
'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',
|
||||
},
|
||||
});
|
||||
|
||||
if (!apiRes) throw new NotFoundError('Failed to fetch video source');
|
||||
if (!apiRes.sources[0].file) throw new NotFoundError('No video source found');
|
||||
ctx.progress(50);
|
||||
|
||||
ctx.progress(90);
|
||||
|
||||
return {
|
||||
embeds: [],
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'hls',
|
||||
playlist: apiRes.sources[0].file,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export const vidapiClickScraper = makeSourcerer({
|
||||
id: 'vidapi-click',
|
||||
name: 'vidapi.click',
|
||||
rank: 89,
|
||||
disabled: false,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
scrapeMovie: comboScraper,
|
||||
scrapeShow: comboScraper,
|
||||
});
|
||||
Loading…
Reference in a new issue