Merge branch 'dev' into ridomovies

This commit is contained in:
Jorrin
2023-12-29 19:33:57 +01:00
committed by GitHub
39 changed files with 487 additions and 100 deletions

View File

@@ -28,12 +28,12 @@ export type FetcherResponse<T = any> = {
};
// This is the version that will be inputted by library users
export type Fetcher<T = any> = {
(url: string, ops: DefaultedFetcherOptions): Promise<FetcherResponse<T>>;
export type Fetcher = {
<T = any>(url: string, ops: DefaultedFetcherOptions): Promise<FetcherResponse<T>>;
};
// This is the version that scrapers will be interacting with
export type UseableFetcher<T = any> = {
(url: string, ops?: FetcherOptions): Promise<T>;
full: (url: string, ops?: FetcherOptions) => Promise<FetcherResponse<T>>;
export type UseableFetcher = {
<T = any>(url: string, ops?: FetcherOptions): Promise<T>;
full: <T = any>(url: string, ops?: FetcherOptions) => Promise<FetcherResponse<T>>;
};

View File

@@ -1,6 +1,6 @@
export type { EmbedOutput, SourcererOutput } from '@/providers/base';
export type { Stream, StreamFile, FileBasedStream, HlsBasedStream, Qualities } from '@/providers/streams';
export type { Fetcher, FetcherOptions, FetcherResponse } from '@/fetchers/types';
export type { Fetcher, DefaultedFetcherOptions, FetcherOptions, FetcherResponse } from '@/fetchers/types';
export type { RunOutput } from '@/runners/runner';
export type { MetaOutput } from '@/entrypoint/utils/meta';
export type { FullScraperEvents } from '@/entrypoint/utils/events';
@@ -9,6 +9,8 @@ export type { MediaTypes, ShowMedia, ScrapeMedia, MovieMedia } from '@/entrypoin
export type { ProviderControls, RunnerOptions, EmbedRunnerOptions, SourceRunnerOptions } from '@/entrypoint/controls';
export type { ProviderBuilder } from '@/entrypoint/builder';
export type { ProviderMakerOptions } from '@/entrypoint/declare';
export type { MovieScrapeContext, ShowScrapeContext, EmbedScrapeContext, ScrapeContext } from '@/utils/context';
export type { SourcererOptions, EmbedOptions } from '@/providers/base';
export { NotFoundError } from '@/utils/errors';
export { makeProviders } from '@/entrypoint/declare';

View File

@@ -38,7 +38,7 @@ export async function formatSource(
embed.embedId = mixdropScraper.id;
break;
default:
throw new Error(`Failed to find ZoeChip embed source for ${link}`);
return null;
}
return embed;

View File

@@ -4,7 +4,6 @@ import { Caption } from '@/providers/captions';
export type StreamFile = {
type: 'mp4';
url: string;
headers?: Record<string, string>;
};
export type Qualities = 'unknown' | '360' | '480' | '720' | '1080' | '4k';

View File

@@ -2,8 +2,8 @@ import { MovieMedia, ShowMedia } from '@/entrypoint/utils/media';
import { UseableFetcher } from '@/fetchers/types';
export type ScrapeContext = {
proxiedFetcher: <T>(...params: Parameters<UseableFetcher<T>>) => ReturnType<UseableFetcher<T>>;
fetcher: <T>(...params: Parameters<UseableFetcher<T>>) => ReturnType<UseableFetcher<T>>;
proxiedFetcher: UseableFetcher;
fetcher: UseableFetcher;
progress(val: number): void;
};