movie-web/src/backend/helpers/provider.ts

24 lines
532 B
TypeScript
Raw Normal View History

import { DetailedMeta } from "../metadata/getmeta";
2023-01-11 21:16:48 +01:00
import { MWMediaType } from "../metadata/types";
import { MWEmbed } from "./embed";
import { MWStream } from "./streams";
export type MWProviderScrapeResult = {
stream?: MWStream;
embeds: MWEmbed[];
};
export type MWProviderContext = {
progress(percentage: number): void;
media: DetailedMeta;
2023-01-11 21:16:48 +01:00
};
export type MWProvider = {
id: string;
rank: number;
disabled?: boolean;
type: MWMediaType[];
scrape(ctx: MWProviderContext): Promise<MWProviderScrapeResult>;
};