Skip to content

Commit 30560e4

Browse files
committed
Add bombthe.irish source 💀 and streamwish embed
1 parent 9af4cad commit 30560e4

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

src/providers/all.ts

+4
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import { mixdropScraper } from '@/providers/embeds/mixdrop';
88
import { mp4uploadScraper } from '@/providers/embeds/mp4upload';
99
import { streambucketScraper } from '@/providers/embeds/streambucket';
1010
import { streamsbScraper } from '@/providers/embeds/streamsb';
11+
import { streamwishScraper } from '@/providers/embeds/streamwish';
1112
import { turbovidScraper } from '@/providers/embeds/turbovid';
1213
import { upcloudScraper } from '@/providers/embeds/upcloud';
1314
import { upstreamScraper } from '@/providers/embeds/upstream';
1415
import { vidsrcembedScraper } from '@/providers/embeds/vidsrc';
1516
import { vTubeScraper } from '@/providers/embeds/vtube';
1617
import { astraScraper, novaScraper, orionScraper } from '@/providers/embeds/whvx';
1718
import { autoembedScraper } from '@/providers/sources/autoembed';
19+
import { bombtheirishScraper } from '@/providers/sources/bombtheirish';
1820
import { catflixScraper } from '@/providers/sources/catflix';
1921
import { ee3Scraper } from '@/providers/sources/ee3';
2022
import { flixhqScraper } from '@/providers/sources/flixhq/index';
@@ -101,6 +103,7 @@ export function gatherAllSources(): Array<Sourcerer> {
101103
whvxScraper,
102104
fsharetvScraper,
103105
redStarScraper,
106+
bombtheirishScraper,
104107
];
105108
}
106109

@@ -149,5 +152,6 @@ export function gatherAllEmbeds(): Array<Embed> {
149152
novaScraper,
150153
astraScraper,
151154
orionScraper,
155+
streamwishScraper,
152156
];
153157
}

src/providers/embeds/streamwish.ts

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as unpacker from 'unpacker';
2+
3+
import { flags } from '@/entrypoint/utils/targets';
4+
import { makeEmbed } from '@/providers/base';
5+
6+
const packedRegex = /(eval\(function\(p,a,c,k,e,d\).*\)\)\))/;
7+
const linkRegex = /file:"(https:\/\/[^"]+)"/;
8+
9+
export const streamwishScraper = makeEmbed({
10+
id: 'streamwish',
11+
name: 'Streamwish',
12+
rank: 216,
13+
async scrape(ctx) {
14+
const streamRes = await ctx.proxiedFetcher<string>(ctx.url);
15+
const packed = streamRes.match(packedRegex);
16+
17+
if (!packed) throw new Error('Packed not found');
18+
19+
const unpacked = unpacker.unpack(packed[1]);
20+
const link = unpacked.match(linkRegex);
21+
22+
if (!link) throw new Error('Stream not found');
23+
return {
24+
stream: [
25+
{
26+
type: 'hls',
27+
id: 'primary',
28+
playlist: link[1],
29+
flags: [flags.CORS_ALLOWED],
30+
captions: [],
31+
},
32+
],
33+
};
34+
},
35+
});

src/providers/sources/bombtheirish.ts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// not a joke, this is a real source
2+
import { load } from 'cheerio';
3+
4+
import { flags } from '@/entrypoint/utils/targets';
5+
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
6+
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
7+
8+
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
9+
const embedPage = await ctx.proxiedFetcher(
10+
`https://bombthe.irish/embed/${ctx.media.type === 'movie' ? `movie/${ctx.media.tmdbId}` : `tv/${ctx.media.tmdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`}`,
11+
);
12+
const $ = load(embedPage);
13+
14+
const embeds: SourcererEmbed[] = [];
15+
16+
$('#dropdownMenu a').each((_, element) => {
17+
const url = new URL($(element).data('url') as string).searchParams.get('url');
18+
if (!url) return;
19+
embeds.push({ embedId: $(element).text().toLowerCase(), url: atob(url) });
20+
});
21+
22+
return { embeds };
23+
}
24+
25+
export const bombtheirishScraper = makeSourcerer({
26+
id: 'bombtheirish',
27+
name: 'bombthe.irish',
28+
rank: 50,
29+
flags: [flags.CORS_ALLOWED],
30+
scrapeMovie: comboScraper,
31+
scrapeShow: comboScraper,
32+
});

0 commit comments

Comments
 (0)