import type { AxiosInstance } from 'axios'; import type { CheerioAPI } from 'cheerio'; import type CryptoJS from 'crypto-js'; import type AnimeParser from './anime-parser'; import type MovieParser from './movie-parser'; import type { ExtractorContext, ExtractorContextConfig } from './extractor-context'; import type MangaParser from './manga-parser'; import { StreamingServers, MediaFormat, MediaStatus, SubOrDub, WatchListType, TvType, Genres, Topics } from './types'; import type { ExtractorManager } from '../utils'; import type { PolyURL, PolyURLSearchParams } from '../utils/url-polyfill'; import type { bypassDdosGuard, getDdosGuardCookiesWithWebView, makeGetRequestWithWebView, makePostRequestWithWebView, makePostRequest, multiply, deobfuscateScript, } from '../NativeConsumet'; /** * Extractor registry type based on your registered extractors */ export interface ExtractorRegistry { AsianLoad: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL, isAlt?: boolean) => Promise; }; Filemoon: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; GogoCDN: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; Kwik: (ctx?: ExtractorContext) => { extract: (url: PolyURL, referer?: string) => Promise; }; MixDrop: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; Mp4Player: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; Mp4Upload: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; RapidCloud: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL, referer?: string) => Promise; }; MegaCloud: (ctx?: ExtractorContext) => { extract: (url: PolyURL, referer?: string) => Promise; }; StreamHub: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; StreamLare: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; StreamSB: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL, isAlt?: boolean) => Promise; }; StreamTape?: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; StreamWish: (ctx?: ExtractorContext) => { extract: (url: PolyURL, referer?: string) => Promise; }; VidMoly: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; VizCloud: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; VidHide: (ctx?: ExtractorContext) => { extract: (url: PolyURL, referer?: string) => Promise; }; Voe: new ( proxyConfig?: any, adapter?: any ) => { extract: (url: URL) => Promise; }; MegaUp: (ctx?: ExtractorContext) => { extract: (url: PolyURL) => Promise; }; MegaPlay: (ctx?: ExtractorContext) => { extract: (url: PolyURL, referer?: string) => Promise; }; GDFlix: (ctx?: ExtractorContext) => { extract: (url: PolyURL | string, ...args: any[]) => Promise; }; Gofile: (ctx?: ExtractorContext) => { extract: (url: PolyURL | string, ...args: any[]) => Promise; }; HubCloud: (ctx?: ExtractorContext) => { extract: (url: PolyURL | string, ...args: any[]) => Promise; }; FlixCloud: (ctx?: ExtractorContext) => { extract: (url: PolyURL, referer?: string) => Promise; }; } export type ProviderConfig = { name: string; languages: string[] | string; classPath: string; baseUrl: string; isNSFW: boolean; logo: string; isWorking?: boolean; isDubAvailableSeparately?: boolean; }; /** * ProviderContext: * Passed into each provider factory function. Gives full access to platform-wide utils and extractors. */ export interface ProviderContext { axios: AxiosInstance; load: (html: string) => CheerioAPI; /** CryptoJS library — use instead of importing crypto-js directly */ CryptoJS: typeof CryptoJS; USER_AGENT: string; AnimeParser: typeof AnimeParser; MovieParser: typeof MovieParser; MangaParser: typeof MangaParser; extractors: ExtractorRegistry; extractorManager?: ExtractorManager; PolyURL: typeof PolyURL; PolyURLSearchParams: typeof PolyURLSearchParams; createCustomBaseUrl: (defaultUrl: string, customUrl?: string) => string; enums: { StreamingServers: typeof StreamingServers; MediaFormat: typeof MediaFormat; MediaStatus: typeof MediaStatus; SubOrDub: typeof SubOrDub; WatchListType: typeof WatchListType; TvType: typeof TvType; Genres: typeof Genres; Topics: typeof Topics; }; NativeConsumet: { getDdosGuardCookiesWithWebView: typeof getDdosGuardCookiesWithWebView; makeGetRequestWithWebView: typeof makeGetRequestWithWebView; makePostRequestWithWebView: typeof makePostRequestWithWebView; makePostRequest: typeof makePostRequest; multiply: typeof multiply; bypassDdosGuard: typeof bypassDdosGuard; deobfuscateScript: typeof deobfuscateScript; }; } /** * Configuration options for creating a provider context */ export interface ProviderContextConfig extends ExtractorContextConfig { /** * Custom AnimeParser base class (optional) - for advanced use cases */ AnimeParser?: typeof AnimeParser; /** * Custom MovieParser base class (optional) - for advanced use cases */ MovieParser?: typeof MovieParser; /** * Custom MangaParser base class (optional) - for advanced use cases */ MangaParser?: typeof MangaParser; }