Fixed syntaxing more

This commit is contained in:
MemeCornucopia
2023-12-12 20:45:34 -05:00
parent 35d61d19a2
commit f3720161ac
2 changed files with 7 additions and 5 deletions

View File

@@ -37,7 +37,7 @@ export async function scrape(ctx: ScrapeContext, media: MovieMedia | ShowMedia,
if (media.type === 'movie') { if (media.type === 'movie') {
id = result.id_movie; id = result.id_movie;
} else if (media.type === 'show') { } else if (media.type === 'show') {
const data = await ctx.fetcher<any>(`https://lmscript.xyz/v1/shows?expand=episodes&id=${result.id_show}`, { const data = await ctx.fetcher<any>(`/v1/shows?expand=episodes&id=${result.id_show}`, {
baseUrl: 'https://lmscript.xyz', baseUrl: 'https://lmscript.xyz',
}); });

View File

@@ -4,13 +4,15 @@ import { ScrapeContext } from '@/utils/context';
export async function getVideoSources(ctx: ScrapeContext, id: any, media: MovieMedia | ShowMedia): Promise<any> { export async function getVideoSources(ctx: ScrapeContext, id: any, media: MovieMedia | ShowMedia): Promise<any> {
// Fetch video sources // Fetch video sources
let url = ''; let path = '';
if (media.type === 'show') { if (media.type === 'show') {
url = `https://lmscript.xyz/v1/episodes/view?expand=streams&id=${id}`; path = `/v1/episodes/view?expand=streams&id=${id}`;
} else if (media.type === 'movie') { } else if (media.type === 'movie') {
url = `https://lmscript.xyz/v1/movies/view?expand=streams&id=${id}`; path = `/v1/movies/view?expand=streams&id=${id}`;
} }
const data = await ctx.fetcher<any>(url).then((d) => d); const data = await ctx.fetcher<any>(path, {
baseUrl: 'https://lmscript.xyz',
});
return data; return data;
} }