Add bombthe.irish source 💀 and streamwish embed
Some checks failed
Testing / Testing (push) Has been cancelled

This commit is contained in:
TPN 2024-12-08 18:37:36 +00:00
parent 9af4cad540
commit 30560e46a3
No known key found for this signature in database
GPG key ID: 40AE091637892B91
3 changed files with 71 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import { mixdropScraper } from '@/providers/embeds/mixdrop';
import { mp4uploadScraper } from '@/providers/embeds/mp4upload';
import { streambucketScraper } from '@/providers/embeds/streambucket';
import { streamsbScraper } from '@/providers/embeds/streamsb';
import { streamwishScraper } from '@/providers/embeds/streamwish';
import { turbovidScraper } from '@/providers/embeds/turbovid';
import { upcloudScraper } from '@/providers/embeds/upcloud';
import { upstreamScraper } from '@/providers/embeds/upstream';
@ -15,6 +16,7 @@ import { vidsrcembedScraper } from '@/providers/embeds/vidsrc';
import { vTubeScraper } from '@/providers/embeds/vtube';
import { astraScraper, novaScraper, orionScraper } from '@/providers/embeds/whvx';
import { autoembedScraper } from '@/providers/sources/autoembed';
import { bombtheirishScraper } from '@/providers/sources/bombtheirish';
import { catflixScraper } from '@/providers/sources/catflix';
import { ee3Scraper } from '@/providers/sources/ee3';
import { flixhqScraper } from '@/providers/sources/flixhq/index';
@ -101,6 +103,7 @@ export function gatherAllSources(): Array<Sourcerer> {
whvxScraper,
fsharetvScraper,
redStarScraper,
bombtheirishScraper,
];
}
@ -149,5 +152,6 @@ export function gatherAllEmbeds(): Array<Embed> {
novaScraper,
astraScraper,
orionScraper,
streamwishScraper,
];
}

View file

@ -0,0 +1,35 @@
import * as unpacker from 'unpacker';
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
const packedRegex = /(eval\(function\(p,a,c,k,e,d\).*\)\)\))/;
const linkRegex = /file:"(https:\/\/[^"]+)"/;
export const streamwishScraper = makeEmbed({
id: 'streamwish',
name: 'Streamwish',
rank: 216,
async scrape(ctx) {
const streamRes = await ctx.proxiedFetcher<string>(ctx.url);
const packed = streamRes.match(packedRegex);
if (!packed) throw new Error('Packed not found');
const unpacked = unpacker.unpack(packed[1]);
const link = unpacked.match(linkRegex);
if (!link) throw new Error('Stream not found');
return {
stream: [
{
type: 'hls',
id: 'primary',
playlist: link[1],
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});

View file

@ -0,0 +1,32 @@
// not a joke, this is a real source
import { load } from 'cheerio';
import { flags } from '@/entrypoint/utils/targets';
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
const embedPage = await ctx.proxiedFetcher(
`https://bombthe.irish/embed/${ctx.media.type === 'movie' ? `movie/${ctx.media.tmdbId}` : `tv/${ctx.media.tmdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`}`,
);
const $ = load(embedPage);
const embeds: SourcererEmbed[] = [];
$('#dropdownMenu a').each((_, element) => {
const url = new URL($(element).data('url') as string).searchParams.get('url');
if (!url) return;
embeds.push({ embedId: $(element).text().toLowerCase(), url: atob(url) });
});
return { embeds };
}
export const bombtheirishScraper = makeSourcerer({
id: 'bombtheirish',
name: 'bombthe.irish',
rank: 50,
flags: [flags.CORS_ALLOWED],
scrapeMovie: comboScraper,
scrapeShow: comboScraper,
});