mirror of
https://github.com/p-stream/providers.git
synced 2026-03-11 17:55:36 +00:00
animetsu sources baybee
This commit is contained in:
parent
86eba4b5bd
commit
5bcad9a6ae
1 changed files with 54 additions and 0 deletions
54
src/providers/sources/animetsu.ts
Normal file
54
src/providers/sources/animetsu.ts
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { getMalIdFromMedia } from '@/utils/mal';
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
const malId = await getMalIdFromMedia(ctx, ctx.media);
|
||||
|
||||
const query: any = {
|
||||
type: ctx.media.type,
|
||||
title: ctx.media.title,
|
||||
tmdbId: ctx.media.tmdbId,
|
||||
imdbId: ctx.media.imdbId,
|
||||
malId,
|
||||
...(ctx.media.type === 'show' && {
|
||||
season: ctx.media.season.number,
|
||||
episode: ctx.media.episode.number,
|
||||
}),
|
||||
...(ctx.media.type === 'movie' && { episode: 1 }),
|
||||
releaseYear: ctx.media.releaseYear,
|
||||
};
|
||||
|
||||
return {
|
||||
embeds: [
|
||||
{
|
||||
embedId: 'animetsu-pahe',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'animetsu-zoro',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'animetsu-zaza',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'animetsu-meg',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
{
|
||||
embedId: 'animetsu-bato',
|
||||
url: JSON.stringify(query),
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export const animetsuScraper = makeSourcerer({
|
||||
id: 'animetsu',
|
||||
name: 'Animetsu',
|
||||
rank: 111, // change this yeah?
|
||||
flags: [],
|
||||
scrapeShow: comboScraper,
|
||||
});
|
||||
Loading…
Reference in a new issue