mirror of
https://github.com/sussy-code/providers.git
synced 2026-04-21 00:22:07 +00:00
Add warezplayer embed
This commit is contained in:
parent
d52dd3dd49
commit
9b9fbc625f
3 changed files with 65 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ import { vidplayScraper } from './embeds/vidplay';
|
||||||
import { voeScraper } from './embeds/voe';
|
import { voeScraper } from './embeds/voe';
|
||||||
import { warezcdnembedHlsScraper } from './embeds/warezcdn/hls';
|
import { warezcdnembedHlsScraper } from './embeds/warezcdn/hls';
|
||||||
import { warezcdnembedMp4Scraper } from './embeds/warezcdn/mp4';
|
import { warezcdnembedMp4Scraper } from './embeds/warezcdn/mp4';
|
||||||
|
import { warezPlayerScraper } from './embeds/warezcdn/warezplayer';
|
||||||
import { wootlyScraper } from './embeds/wootly';
|
import { wootlyScraper } from './embeds/wootly';
|
||||||
import { goojaraScraper } from './sources/goojara';
|
import { goojaraScraper } from './sources/goojara';
|
||||||
import { hdRezkaScraper } from './sources/hdrezka';
|
import { hdRezkaScraper } from './sources/hdrezka';
|
||||||
|
|
@ -133,6 +134,7 @@ export function gatherAllEmbeds(): Array<Embed> {
|
||||||
vTubeScraper,
|
vTubeScraper,
|
||||||
warezcdnembedHlsScraper,
|
warezcdnembedHlsScraper,
|
||||||
warezcdnembedMp4Scraper,
|
warezcdnembedMp4Scraper,
|
||||||
|
warezPlayerScraper,
|
||||||
bflixScraper,
|
bflixScraper,
|
||||||
playm4uNMScraper,
|
playm4uNMScraper,
|
||||||
hydraxScraper,
|
hydraxScraper,
|
||||||
|
|
|
||||||
58
src/providers/embeds/warezcdn/warezplayer.ts
Normal file
58
src/providers/embeds/warezcdn/warezplayer.ts
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
import { makeEmbed } from '@/providers/base';
|
||||||
|
import { warezcdnApiBase, warezcdnPlayerBase } from '@/providers/sources/warezcdn/common';
|
||||||
|
|
||||||
|
export const warezPlayerScraper = makeEmbed({
|
||||||
|
id: 'warezplayer',
|
||||||
|
name: 'warezPLAYER',
|
||||||
|
rank: 85,
|
||||||
|
async scrape(ctx) {
|
||||||
|
const page = await ctx.proxiedFetcher.full<string>(`/player.php`, {
|
||||||
|
baseUrl: warezcdnPlayerBase,
|
||||||
|
headers: {
|
||||||
|
Referer: `${warezcdnApiBase}/getEmbed.php?${new URLSearchParams({
|
||||||
|
id: ctx.url,
|
||||||
|
sv: 'warezcdn',
|
||||||
|
})}`,
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
id: ctx.url,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// ex url: https://basseqwevewcewcewecwcw.xyz/video/0e4a2c65bdaddd66a53422d93daebe68
|
||||||
|
const playerPageUrl = new URL(page.finalUrl);
|
||||||
|
|
||||||
|
const hash = playerPageUrl.pathname.split('/')[2];
|
||||||
|
const playerApiRes = await ctx.proxiedFetcher('/player/index.php', {
|
||||||
|
baseUrl: playerPageUrl.origin,
|
||||||
|
query: {
|
||||||
|
data: hash,
|
||||||
|
do: 'getVideo',
|
||||||
|
},
|
||||||
|
method: 'POST',
|
||||||
|
body: new URLSearchParams({
|
||||||
|
hash,
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
'X-Requested-With': 'XMLHttpRequest',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const sources = JSON.parse(playerApiRes); // json isn't parsed by fetcher due to content-type being text/html.
|
||||||
|
if (!sources.videoSource) throw new Error('Playlist not found');
|
||||||
|
|
||||||
|
return {
|
||||||
|
stream: [
|
||||||
|
{
|
||||||
|
id: 'primary',
|
||||||
|
type: 'hls',
|
||||||
|
flags: [],
|
||||||
|
captions: [],
|
||||||
|
playlist: sources.videoSource,
|
||||||
|
headers: {
|
||||||
|
// without this it returns "security error"
|
||||||
|
Accept: '*/*',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
@ -5,6 +5,7 @@ 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';
|
||||||
|
import { warezPlayerScraper } from '@/providers/embeds/warezcdn/warezplayer';
|
||||||
import { NotFoundError } from '@/utils/errors';
|
import { NotFoundError } from '@/utils/errors';
|
||||||
|
|
||||||
import { getExternalPlayerUrl, warezcdnBase } from './common';
|
import { getExternalPlayerUrl, warezcdnBase } from './common';
|
||||||
|
|
@ -48,6 +49,10 @@ export const warezcdnScraper = makeSourcerer({
|
||||||
embedId: warezcdnembedMp4Scraper.id,
|
embedId: warezcdnembedMp4Scraper.id,
|
||||||
url: embedUrl,
|
url: embedUrl,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
embedId: warezPlayerScraper.id,
|
||||||
|
url: embedUrl,
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue