mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:33:26 +00:00
complete requested changes
This commit is contained in:
@@ -23,7 +23,7 @@ function decrypt(input: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function getDecryptedId(ctx: EmbedScrapeContext) {
|
export async function getDecryptedId(ctx: EmbedScrapeContext) {
|
||||||
const page = await ctx.proxiedFetcher<string>(`/player.php?${new URLSearchParams({ id: ctx.url })}`, {
|
const page = await ctx.proxiedFetcher<string>(`/player.php`, {
|
||||||
baseUrl: warezcdnPlayerBase,
|
baseUrl: warezcdnPlayerBase,
|
||||||
headers: {
|
headers: {
|
||||||
Referer: `${warezcdnPlayerBase}/getEmbed.php?${new URLSearchParams({
|
Referer: `${warezcdnPlayerBase}/getEmbed.php?${new URLSearchParams({
|
||||||
@@ -31,6 +31,9 @@ export async function getDecryptedId(ctx: EmbedScrapeContext) {
|
|||||||
sv: 'warezcdn',
|
sv: 'warezcdn',
|
||||||
})}`,
|
})}`,
|
||||||
},
|
},
|
||||||
|
query: {
|
||||||
|
id: ctx.url,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const allowanceKey = page.match(/let allowanceKey = "(.*?)";/)?.[1];
|
const allowanceKey = page.match(/let allowanceKey = "(.*?)";/)?.[1];
|
||||||
if (!allowanceKey) throw new NotFoundError('Failed to get allowanceKey');
|
if (!allowanceKey) throw new NotFoundError('Failed to get allowanceKey');
|
||||||
@@ -53,5 +56,3 @@ export async function getDecryptedId(ctx: EmbedScrapeContext) {
|
|||||||
|
|
||||||
return decryptedId;
|
return decryptedId;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const warezcdnWorkerProxy = 'https://workerproxy.warezcdn.workers.dev';
|
|
||||||
|
@@ -1,8 +1,9 @@
|
|||||||
import { makeEmbed } from '@/providers/base';
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
import { warezcdnWorkerProxy } from '@/providers/sources/warezcdn/common';
|
||||||
import { EmbedScrapeContext } from '@/utils/context';
|
import { EmbedScrapeContext } from '@/utils/context';
|
||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
import { getDecryptedId, warezcdnWorkerProxy } from './common';
|
import { getDecryptedId } from './common';
|
||||||
|
|
||||||
const cdnListing = [50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64];
|
const cdnListing = [50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64];
|
||||||
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
export const warezcdnBase = 'https://embed.warezcdn.com';
|
export const warezcdnBase = 'https://embed.warezcdn.com';
|
||||||
export const warezcdnApiBase = 'https://warezcdn.com/embed';
|
export const warezcdnApiBase = 'https://warezcdn.com/embed';
|
||||||
export const warezcdnPlayerBase = 'https://warezcdn.com/player';
|
export const warezcdnPlayerBase = 'https://warezcdn.com/player';
|
||||||
|
export const warezcdnWorkerProxy = 'https://workerproxy.warezcdn.workers.dev';
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { load } from 'cheerio';
|
import { load } from 'cheerio';
|
||||||
|
|
||||||
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
|
import { SourcererEmbed, makeSourcerer } from '@/providers/base';
|
||||||
import { mixdropScraper } from '@/providers/embeds/mixdrop';
|
import { mixdropScraper } from '@/providers/embeds/mixdrop';
|
||||||
import { warezcdnembedHlsScraper } from '@/providers/embeds/warezcdn/hls';
|
import { warezcdnembedHlsScraper } from '@/providers/embeds/warezcdn/hls';
|
||||||
import { warezcdnembedMp4Scraper } from '@/providers/embeds/warezcdn/mp4';
|
import { warezcdnembedMp4Scraper } from '@/providers/embeds/warezcdn/mp4';
|
||||||
@@ -30,15 +30,16 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
|||||||
const embedUrl = $(element).attr('data-load-embed')!;
|
const embedUrl = $(element).attr('data-load-embed')!;
|
||||||
|
|
||||||
if (embedHost === 'mixdrop') {
|
if (embedHost === 'mixdrop') {
|
||||||
const params = new URLSearchParams({
|
const params = {
|
||||||
id: embedUrl,
|
id: embedUrl,
|
||||||
sv: 'mixdrop',
|
sv: 'mixdrop',
|
||||||
});
|
};
|
||||||
const realUrl = await ctx.proxiedFetcher<string>(`/getPlay.php?${params}`, {
|
const realUrl = await ctx.proxiedFetcher<string>(`/getPlay.php`, {
|
||||||
baseUrl: warezcdnApiBase,
|
baseUrl: warezcdnApiBase,
|
||||||
headers: {
|
headers: {
|
||||||
Referer: `${warezcdnApiBase}/getEmbed.php?${params}`,
|
Referer: `${warezcdnApiBase}/getEmbed.php?${new URLSearchParams(params)}`,
|
||||||
},
|
},
|
||||||
|
query: params,
|
||||||
});
|
});
|
||||||
|
|
||||||
const realEmbedUrl = realUrl.match(/window\.location\.href="([^"]*)";/);
|
const realEmbedUrl = realUrl.match(/window\.location\.href="([^"]*)";/);
|
||||||
@@ -63,7 +64,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
embeds,
|
embeds,
|
||||||
} as SourcererOutput;
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const warezcdnScraper = makeSourcerer({
|
export const warezcdnScraper = makeSourcerer({
|
||||||
|
Reference in New Issue
Block a user