mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:33:25 +00:00
complete requested changes
This commit is contained in:
@@ -72,7 +72,7 @@ async function getStream(
|
|||||||
return JSON.parse(response);
|
return JSON.parse(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTranslator(
|
async function getTranslatorId(
|
||||||
url: string,
|
url: string,
|
||||||
id: string,
|
id: string,
|
||||||
ctx: ShowScrapeContext | MovieScrapeContext,
|
ctx: ShowScrapeContext | MovieScrapeContext,
|
||||||
@@ -94,9 +94,9 @@ async function getTranslator(
|
|||||||
|
|
||||||
const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> => {
|
const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> => {
|
||||||
const result = await searchAndFindMediaId(ctx);
|
const result = await searchAndFindMediaId(ctx);
|
||||||
if (!result) throw new NotFoundError('No result found');
|
if (!result || !result.id) throw new NotFoundError('No result found');
|
||||||
|
|
||||||
const translatorId = await getTranslator(result.url, result.id, ctx);
|
const translatorId = await getTranslatorId(result.url, result.id, ctx);
|
||||||
if (!translatorId) throw new NotFoundError('No translator id found');
|
if (!translatorId) throw new NotFoundError('No translator id found');
|
||||||
|
|
||||||
const { url: streamUrl, subtitle: streamSubtitle } = await getStream(result.id, translatorId, ctx);
|
const { url: streamUrl, subtitle: streamSubtitle } = await getStream(result.id, translatorId, ctx);
|
||||||
|
@@ -13,7 +13,7 @@ export type VideoLinks = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export interface MovieData {
|
export interface MovieData {
|
||||||
id: string;
|
id: string | null;
|
||||||
year: number;
|
year: number;
|
||||||
type: ScrapeMedia['type'];
|
type: ScrapeMedia['type'];
|
||||||
url: string;
|
url: string;
|
||||||
|
Reference in New Issue
Block a user