2023-01-14 00:12:56 +01:00
|
|
|
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;
|
2023-01-14 00:12:56 +01:00
|
|
|
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>;
|
|
|
|
};
|