mirror of
https://github.com/p-stream/providers.git
synced 2026-05-11 20:00:53 +00:00
47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import { flags } from '@/entrypoint/utils/targets';
|
|
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
|
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
|
|
|
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
|
const query = {
|
|
type: ctx.media.type,
|
|
title: ctx.media.title,
|
|
tmdbId: ctx.media.tmdbId,
|
|
imdbId: ctx.media.imdbId,
|
|
...(ctx.media.type === 'show' && {
|
|
season: ctx.media.season.number,
|
|
episode: ctx.media.episode.number,
|
|
}),
|
|
releaseYear: ctx.media.releaseYear,
|
|
};
|
|
|
|
const embeds = [
|
|
{
|
|
embedId: 'madplay-base',
|
|
url: JSON.stringify(query),
|
|
},
|
|
{
|
|
embedId: 'madplay-nsapi',
|
|
url: JSON.stringify(query),
|
|
},
|
|
{
|
|
embedId: 'madplay-roper',
|
|
url: JSON.stringify(query),
|
|
},
|
|
{
|
|
embedId: 'madplay-vidfast',
|
|
url: JSON.stringify(query),
|
|
},
|
|
];
|
|
|
|
return { embeds };
|
|
}
|
|
|
|
export const madplayScraper = makeSourcerer({
|
|
id: 'madplay',
|
|
name: 'Flicky',
|
|
rank: 155,
|
|
flags: [flags.CORS_ALLOWED],
|
|
scrapeMovie: comboScraper,
|
|
scrapeShow: comboScraper,
|
|
});
|