mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 18:13:25 +00:00
more prettier stuff
This commit is contained in:
@@ -23,7 +23,7 @@ interface MovieConfig extends BaseConfig {
|
|||||||
}
|
}
|
||||||
export type Config = MovieConfig | TvConfig;
|
export type Config = MovieConfig | TvConfig;
|
||||||
|
|
||||||
export type EmbedsResult = { embedId: string; url: string; }[]
|
export type EmbedsResult = { embedId: string; url: string }[];
|
||||||
|
|
||||||
export interface Result {
|
export interface Result {
|
||||||
title: string;
|
title: string;
|
||||||
|
@@ -6,7 +6,7 @@ import { ScrapeContext } from '@/utils/context';
|
|||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
import { getEmbeds } from './getEmbeds';
|
import { getEmbeds } from './getEmbeds';
|
||||||
import { Result, EmbedsResult } from './type';
|
import { EmbedsResult, Result } from './type';
|
||||||
|
|
||||||
const headersData = {
|
const headersData = {
|
||||||
accept: '*/*',
|
accept: '*/*',
|
||||||
@@ -32,7 +32,7 @@ export async function searchAndFindMedia(
|
|||||||
headers: headersData,
|
headers: headersData,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: `q=${media.title}`,
|
body: `q=${media.title}`,
|
||||||
})
|
});
|
||||||
|
|
||||||
const $ = load(data);
|
const $ = load(data);
|
||||||
|
|
||||||
@@ -58,7 +58,11 @@ export async function searchAndFindMedia(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function scrapeIds(ctx: ScrapeContext, media: MovieMedia | ShowMedia, result: Result): Promise<EmbedsResult> {
|
export async function scrapeIds(
|
||||||
|
ctx: ScrapeContext,
|
||||||
|
media: MovieMedia | ShowMedia,
|
||||||
|
result: Result,
|
||||||
|
): Promise<EmbedsResult> {
|
||||||
// Find the relevant id
|
// Find the relevant id
|
||||||
let id = null;
|
let id = null;
|
||||||
if (media.type === 'movie') {
|
if (media.type === 'movie') {
|
||||||
|
Reference in New Issue
Block a user