mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:03:26 +00:00
Start building a provider scrape system
This commit is contained in:
6
src/utils/context.ts
Normal file
6
src/utils/context.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Fetcher } from '@/utils/fetcher';
|
||||
|
||||
export interface ScrapeContext {
|
||||
proxiedFetcher: Fetcher;
|
||||
fetcher: Fetcher;
|
||||
}
|
11
src/utils/fetcher.ts
Normal file
11
src/utils/fetcher.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export type FetcherOptions = {
|
||||
baseUrl?: string;
|
||||
headers?: Record<string, string>;
|
||||
query?: Record<string, string>;
|
||||
method?: 'GET' | 'POST';
|
||||
body?: Record<string, any> | string | FormData;
|
||||
};
|
||||
|
||||
export type Fetcher<T = any> = {
|
||||
(url: string, ops?: FetcherOptions): T;
|
||||
};
|
Reference in New Issue
Block a user