add types

This commit is contained in:
lonelil 2024-04-11 19:29:35 +08:00
parent c17b74c8ba
commit 9ba05ab991
No known key found for this signature in database
3 changed files with 5 additions and 4 deletions

View File

@ -35,7 +35,7 @@ export async function getDecryptedId(ctx: EmbedScrapeContext) {
const allowanceKey = page.match(/let allowanceKey = "(.*?)";/)?.[1];
if (!allowanceKey) throw new NotFoundError('Failed to get allowanceKey');
const streamData = await ctx.proxiedFetcher('/functions.php', {
const streamData = await ctx.proxiedFetcher<string>('/functions.php', {
baseUrl: warezcdnPlayerBase,
method: 'POST',
body: new URLSearchParams({

View File

@ -7,7 +7,7 @@ import { getDecryptedId } from './common';
// Method found by atpn
async function getVideowlUrlStream(ctx: EmbedScrapeContext, decryptedId: string) {
const sharePage = await ctx.proxiedFetcher('https://cloud.mail.ru/public/uaRH/2PYWcJRpH');
const sharePage = await ctx.proxiedFetcher<string>('https://cloud.mail.ru/public/uaRH/2PYWcJRpH');
const regex = /"videowl_view":\{"count":"(\d+)","url":"([^"]+)"\}/g;
const videowlUrl = regex.exec(sharePage)?.[2];

View File

@ -16,7 +16,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
if (ctx.media.type === 'show')
id = `serie/${ctx.media.imdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`;
const serversPage = await ctx.proxiedFetcher(`/${id}`, {
const serversPage = await ctx.proxiedFetcher<string>(`/${id}`, {
baseUrl: warezcdnBase,
});
const $ = load(serversPage);
@ -34,7 +34,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
id: embedUrl,
sv: 'mixdrop',
});
const realUrl = await ctx.proxiedFetcher(`/getPlay.php?${params}`, {
const realUrl = await ctx.proxiedFetcher<string>(`/getPlay.php?${params}`, {
baseUrl: warezcdnApiBase,
headers: {
Referer: `${warezcdnApiBase}/getEmbed.php?${params}`,
@ -42,6 +42,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
});
const realEmbedUrl = realUrl.match(/window\.location\.href="([^"]*)";/);
if (!realEmbedUrl) throw new Error('Could not find embed url');
embeds.push({
embedId: mixdropScraper.id,
url: realEmbedUrl[1],