45 Commits

Author SHA1 Message Date
Jorrin
356286dfaa Merge branch 'dev' of https://github.com/infvortx/providers-dev into pr/146 2024-04-11 19:44:19 +02:00
Jorrin
534b53f9b9 Merge branch 'dev' into pr/146 2024-04-11 19:44:06 +02:00
teddyHV11
2553909e8d Merge branch 'dev' of https://github.com/infvortx/providers-dev into dev 2024-04-11 17:49:33 +03:00
teddyHV11
6a0ac52908 Fix prettier errors 2024-04-11 17:49:32 +03:00
Jorrin
116cc1c3c3 Merge pull request #149 from movie-web/feature/soapertv
Add soapertv source
2024-04-11 15:50:32 +02:00
Jorrin
0ede244c2b Merge branch 'dev' into dev 2024-04-11 15:48:11 +02:00
chaos
5be81a3142 Merge branch 'dev' into feature/soapertv 2024-04-11 14:37:36 +03:00
Jorrin
047b69c309 Merge pull request #150 from Ciarands/dev
Fix vidsrc.me
2024-04-11 13:18:57 +02:00
Ciarands
61952b0e87 Remove CORS_ALLOWED flag and add headers 2024-04-11 12:08:31 +01:00
Ciarands
125021e432 remove CORS_ALLOWED flag 2024-04-11 12:08:03 +01:00
Ciarands
9e06035e27 Update RCP base url 2024-04-11 12:03:04 +01:00
teddyHV11
8281c3141a Rename insertunit.ts to index.ts 2024-04-11 06:31:53 +03:00
teddyHV11
8796b39a63 Fix prettier errors 2024-04-11 04:18:38 +03:00
teddyHV11
6b038a288c Clarity fixes 2024-04-11 03:57:42 +03:00
Jorrin
ec6524389c add soapertv source 2024-04-10 22:40:55 +02:00
teddyHV11
5d6b93385e Types adjustment, extract captions to a function 2024-04-10 07:24:53 +03:00
teddyHV11
5b836a4839 Fix mistake done with captions
Swap languages and type's place
2024-04-09 17:44:41 +03:00
infvortx
082d2754be Merge branch 'movie-web:dev' into dev 2024-04-09 09:49:32 +03:00
teddyHV11
921c35b3ed Add caption scraping + types 2024-04-09 07:16:41 +03:00
William Oldham
09eadfd306 Merge pull request #148 from movie-web/feature/disable-showbox
Disable showbox
2024-04-08 15:10:51 +01:00
Jorrin
fbbb671967 Merge branch 'dev' into dev 2024-04-08 16:09:37 +02:00
Jorrin
2daded1d79 Disable showbox 2024-04-08 15:37:41 +02:00
teddyHV11
7dc5a5ac83 Fix series scraping
Series scraping was off for some series, this fixes it + also adds support for episodes that are in multiple parts (continuation of each other) as the provider returns them as a single file in episode ranges.
2024-04-07 15:33:04 +03:00
Jorrin
ecf46817d4 Merge pull request #147 from ztpn/vidsrc.me
Vidsrc.me
2024-04-07 13:43:20 +02:00
Jorrin
7d87e77695 Merge branch 'dev' into vidsrc.me 2024-04-07 13:39:59 +02:00
TPN
e75fe05ad2 revert settings.json 2024-04-07 11:37:38 +00:00
TPN
fa8e3fa7e1 fix vidsrc 2024-04-07 11:21:48 +00:00
teddyHV11
73facc0184 Merge branch 'dev' of https://github.com/infvortx/providers-dev into dev 2024-04-07 11:54:37 +03:00
teddyHV11
68fe85065f Updated provider name 2024-04-07 11:54:34 +03:00
infvortx
8a711265cb Update insertunit.ts 2024-04-07 11:48:04 +03:00
infvortx
a58ea29ae5 Merge branch 'movie-web:dev' into dev 2024-04-07 10:53:44 +03:00
teddyHV11
d99a22d734 Add insertunit 2024-04-07 10:53:09 +03:00
Jorrin
29d0ea4276 add ridomovies search to changelog 2024-04-05 20:01:45 +02:00
Jorrin
3ae517c2d2 Merge pull request #145 from ztpn/rido
fix ridomovies search
2024-04-05 20:00:14 +02:00
TPN
718eb97c06 check year 2024-04-05 23:28:49 +05:30
Jorrin
68a70b1177 Merge branch 'dev' into rido 2024-04-05 19:54:00 +02:00
Jorrin
a6667ade8c remove unused flag 2024-04-05 19:52:43 +02:00
TPN
301c9200ad fix ridomovies search 2024-04-05 17:41:43 +00:00
Jorrin
2661e24908 bump version and changelog 2024-04-05 19:26:01 +02:00
Jorrin
95e4578eee Merge pull request #142 from movie-web/dependabot/npm_and_yarn/dot-docs/undici-5.28.4
Bump undici from 5.28.3 to 5.28.4 in /.docs
2024-04-05 17:36:10 +02:00
Jorrin
18a3d9d9e6 Merge pull request #143 from ztpn/smashystream
fix smashystream
2024-04-05 17:35:57 +02:00
TPN
296216c734 fix all.ts 2024-04-05 20:54:21 +05:30
TPN
7d5dca227d Update all.ts 2024-04-05 20:51:32 +05:30
TPN
4238672f28 fix smashystream 2024-04-05 11:33:28 +00:00
dependabot[bot]
867313fce1 Bump undici from 5.28.3 to 5.28.4 in /.docs
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-04 17:40:39 +00:00
19 changed files with 408 additions and 153 deletions

View File

@@ -2,6 +2,12 @@
title: 'Changelog'
---
# Version 2.2.9
- Fixed VidSrcTo (both Vidplay and Filemoon embeds)
- Added dropload, filelions and vtube embeds to Primewire
- Fixed and enabled Smashystream
- Improved RidoMovies search results
# Version 2.2.8
- Fix package exports for CJS and ESM
- Fixed Mixdrop embed

6
.docs/pnpm-lock.yaml generated
View File

@@ -7370,7 +7370,7 @@ packages:
fast-glob: 3.3.2
js-yaml: 4.1.0
supports-color: 9.4.0
undici: 5.28.3
undici: 5.28.4
yargs-parser: 21.1.1
dev: true
@@ -9117,8 +9117,8 @@ packages:
resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==}
dev: true
/undici@5.28.3:
resolution: {integrity: sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==}
/undici@5.28.4:
resolution: {integrity: sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==}
engines: {node: '>=14.0'}
dependencies:
'@fastify/busboy': 2.1.1

View File

@@ -1,6 +1,6 @@
{
"name": "@movie-web/providers",
"version": "2.2.8",
"version": "2.2.9",
"description": "Package that contains all the providers of movie-web",
"type": "module",
"main": "./lib/index.js",

View File

@@ -14,6 +14,7 @@ import { vidsrcembedScraper } from '@/providers/embeds/vidsrc';
import { vTubeScraper } from '@/providers/embeds/vtube';
import { flixhqScraper } from '@/providers/sources/flixhq/index';
import { goMoviesScraper } from '@/providers/sources/gomovies/index';
import { insertunitScraper } from '@/providers/sources/insertunit';
import { kissAsianScraper } from '@/providers/sources/kissasian/index';
import { lookmovieScraper } from '@/providers/sources/lookmovie';
import { remotestreamScraper } from '@/providers/sources/remotestream';
@@ -24,7 +25,7 @@ import { zoechipScraper } from '@/providers/sources/zoechip';
import { closeLoadScraper } from './embeds/closeload';
import { fileMoonScraper } from './embeds/filemoon';
import { ridooScraper } from './embeds/ridoo';
import { smashyStreamDScraper } from './embeds/smashystream/dued';
import { smashyStreamOScraper } from './embeds/smashystream/opstream';
import { smashyStreamFScraper } from './embeds/smashystream/video1';
import { streamtapeScraper } from './embeds/streamtape';
import { streamvidScraper } from './embeds/streamvid';
@@ -38,6 +39,7 @@ import { nepuScraper } from './sources/nepu';
import { primewireScraper } from './sources/primewire';
import { ridooMoviesScraper } from './sources/ridomovies';
import { smashyStreamScraper } from './sources/smashystream';
import { soaperTvScraper } from './sources/soapertv';
import { vidSrcToScraper } from './sources/vidsrcto';
export function gatherAllSources(): Array<Sourcerer> {
@@ -58,6 +60,8 @@ export function gatherAllSources(): Array<Sourcerer> {
goojaraScraper,
hdRezkaScraper,
primewireScraper,
insertunitScraper,
soaperTvScraper,
];
}
@@ -75,7 +79,7 @@ export function gatherAllEmbeds(): Array<Embed> {
vidsrcembedScraper,
streambucketScraper,
smashyStreamFScraper,
smashyStreamDScraper,
smashyStreamOScraper,
ridooScraper,
closeLoadScraper,
fileMoonScraper,

View File

@@ -1,8 +1,6 @@
import { load } from 'cheerio';
import { unpack } from 'unpacker';
import { flags } from '@/entrypoint/utils/targets';
import { SubtitleResult } from './types';
import { makeEmbed } from '../../base';
import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '../../captions';

View File

@@ -1,71 +0,0 @@
import { load } from 'cheerio';
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
type DPlayerSourcesResponse = {
title: string;
id: string;
file: string;
}[];
export const smashyStreamDScraper = makeEmbed({
id: 'smashystream-d',
name: 'SmashyStream (D)',
rank: 71,
async scrape(ctx) {
const mainPageRes = await ctx.proxiedFetcher<string>(ctx.url, {
headers: {
Referer: ctx.url,
},
});
const mainPageRes$ = load(mainPageRes);
const iframeUrl = mainPageRes$('iframe').attr('src');
if (!iframeUrl) throw new Error(`[${this.name}] failed to find iframe url`);
const mainUrl = new URL(iframeUrl);
const iframeRes = await ctx.proxiedFetcher<string>(iframeUrl, {
headers: {
Referer: ctx.url,
},
});
const textFilePath = iframeRes.match(/"file":"([^"]+)"/)?.[1];
const csrfToken = iframeRes.match(/"key":"([^"]+)"/)?.[1];
if (!textFilePath || !csrfToken) throw new Error(`[${this.name}] failed to find text file url or token`);
const textFileUrl = `${mainUrl.origin}${textFilePath}`;
const textFileRes = await ctx.proxiedFetcher<DPlayerSourcesResponse>(textFileUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-TOKEN': csrfToken,
Referer: iframeUrl,
},
});
// Playlists in Hindi, English, Tamil and Telugu are available. We only get the english one.
const textFilePlaylist = textFileRes.find((x) => x.title === 'English')?.file;
if (!textFilePlaylist) throw new Error(`[${this.name}] failed to find an english playlist`);
const playlistRes = await ctx.proxiedFetcher<string>(
`${mainUrl.origin}/playlist/${textFilePlaylist.slice(1)}.txt`,
{
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-CSRF-TOKEN': csrfToken,
Referer: iframeUrl,
},
},
);
return {
stream: [
{
id: 'primary',
playlist: playlistRes,
type: 'hls',
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});

View File

@@ -0,0 +1,17 @@
import { makeEmbed } from '@/providers/base';
import { smashyStreamFScraper } from './video1';
export const smashyStreamOScraper = makeEmbed({
// the scraping logic for all smashystream embeds is the same
// all the embeds can be added in the same way
id: 'smashystream-o',
name: 'SmashyStream (O)',
rank: 70,
async scrape(ctx) {
const result = await smashyStreamFScraper.scrape(ctx);
return {
stream: result.stream,
};
},
});

View File

@@ -1,16 +1,29 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '@/providers/captions';
import { NotFoundError } from '@/utils/errors';
type FPlayerResponse = {
sourceUrls: string[];
subtitleUrls: string;
subtitles: string | null;
};
// if you don't understand how this is reversed
// check https://discord.com/channels/871713465100816424/1186646348137775164/1225644477188935770
// feel free to reach out atpn or ciaran_ds on discord if you've any problems
function decode(str: string): string {
const b = ['U0ZML2RVN0IvRGx4', 'MGNhL0JWb0kvTlM5', 'Ym94LzJTSS9aU0Zj', 'SGJ0L1dGakIvN0dX', 'eE52L1QwOC96N0Yz'];
let formatedB64 = str.slice(2);
for (let i = 4; i > -1; i--) {
formatedB64 = formatedB64.replace(`//${b[i]}`, '');
}
return atob(formatedB64);
}
export const smashyStreamFScraper = makeEmbed({
id: 'smashystream-f',
name: 'SmashyStream (F)',
rank: 70,
rank: 71,
async scrape(ctx) {
const res = await ctx.proxiedFetcher<FPlayerResponse>(ctx.url, {
headers: {
@@ -18,15 +31,20 @@ export const smashyStreamFScraper = makeEmbed({
},
});
if (!res.sourceUrls[0]) throw new NotFoundError('No watchable item found');
const playlist = decode(res.sourceUrls[0]);
if (!playlist.includes('.m3u8')) throw new Error('Failed to decode');
const captions: Caption[] =
res.subtitleUrls
.match(/\[([^\]]+)\](https?:\/\/\S+?)(?=,\[|$)/g)
res.subtitles
?.match(/\[([^\]]+)\](https?:\/\/\S+?)(?=,\[|$)/g)
?.map<Caption | null>((entry: string) => {
const match = entry.match(/\[([^\]]+)\](https?:\/\/\S+?)(?=,\[|$)/);
if (match) {
const [, language, url] = match;
if (language && url) {
const languageCode = labelToLanguageCode(language);
const languageCode = labelToLanguageCode(language.replace(/ - .*/, ''));
const captionType = getCaptionTypeFromUrl(url);
if (!languageCode || !captionType) return null;
return {
@@ -46,7 +64,7 @@ export const smashyStreamFScraper = makeEmbed({
stream: [
{
id: 'primary',
playlist: res.sourceUrls[0],
playlist,
type: 'hls',
flags: [flags.CORS_ALLOWED],
captions,

View File

@@ -1,5 +1,5 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
import { vidsrcRCPBase } from '@/providers/sources/vidsrc/common';
const hlsURLRegex = /file:"(.*?)"/;
const setPassRegex = /var pass_path = "(.*set_pass\.php.*)";/;
@@ -32,28 +32,35 @@ export const vidsrcembedScraper = makeEmbed({
if (!finalUrl.includes('.m3u8')) throw new Error('Unable to find HLS playlist');
let setPassLink = html.match(setPassRegex)?.[1];
if (!setPassLink) throw new Error('Unable to find set_pass.php link');
if (setPassLink.startsWith('//')) {
setPassLink = `https:${setPassLink}`;
// isn't neeeded, the stream works without it anyway
// shouldn't fail if the setpass link is not found
if (setPassLink) {
if (setPassLink.startsWith('//')) {
setPassLink = `https:${setPassLink}`;
}
// VidSrc uses a password endpoint to temporarily whitelist the user's IP. This is called in an interval by the player.
// It currently has no effect on the player itself, the content plays fine without it.
// In the future we might have to introduce hooks for the frontend to call this endpoint.
await ctx.proxiedFetcher(setPassLink, {
headers: {
referer: ctx.url,
},
});
}
// VidSrc uses a password endpoint to temporarily whitelist the user's IP. This is called in an interval by the player.
// It currently has no effect on the player itself, the content plays fine without it.
// In the future we might have to introduce hooks for the frontend to call this endpoint.
await ctx.proxiedFetcher(setPassLink, {
headers: {
referer: ctx.url,
},
});
return {
stream: [
{
id: 'primary',
type: 'hls',
playlist: finalUrl,
flags: [flags.CORS_ALLOWED],
headers: {
Referer: vidsrcRCPBase,
Origin: vidsrcRCPBase,
},
flags: [],
captions: [],
},
],

View File

@@ -0,0 +1,30 @@
import { Caption, removeDuplicatedLanguages } from '@/providers/captions';
import { Subtitle } from './types';
export async function getCaptions(data: Subtitle[]) {
let captions: Caption[] = [];
for (const subtitle of data) {
let language = '';
if (subtitle.name.includes('Рус')) {
language = 'ru';
} else if (subtitle.name.includes('Укр')) {
language = 'uk';
} else if (subtitle.name.includes('Eng')) {
language = 'en';
} else {
continue;
}
captions.push({
id: subtitle.url,
url: subtitle.url,
language,
type: 'vtt',
hasCorsRestrictions: false,
});
}
captions = removeDuplicatedLanguages(captions);
return captions;
}

View File

@@ -0,0 +1,103 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeSourcerer } from '@/providers/base';
import { Caption } from '@/providers/captions';
import { NotFoundError } from '@/utils/errors';
import { getCaptions } from './captions';
import { Season } from './types';
const insertUnitBase = 'https://api.insertunit.ws/';
export const insertunitScraper = makeSourcerer({
id: 'insertunit',
name: 'Insertunit',
disabled: false,
rank: 60,
flags: [flags.CORS_ALLOWED],
async scrapeShow(ctx) {
const playerData = await ctx.fetcher<string>(`/embed/imdb/${ctx.media.imdbId}`, {
baseUrl: insertUnitBase,
});
ctx.progress(30);
const seasonDataJSONregex = /seasons:(.*)/;
const seasonData = seasonDataJSONregex.exec(playerData);
if (seasonData === null || seasonData[1] === null) {
throw new NotFoundError('No result found');
}
ctx.progress(60);
const seasonTable: Season[] = JSON.parse(seasonData[1]) as Season[];
const currentSeason = seasonTable.find(
(seasonElement) => seasonElement.season === ctx.media.season.number && !seasonElement.blocked,
);
const currentEpisode = currentSeason?.episodes.find((episodeElement) =>
episodeElement.episode.includes(ctx.media.episode.number.toString()),
);
if (!currentEpisode?.hls) throw new NotFoundError('No result found');
let captions: Caption[] = [];
if (currentEpisode.cc != null) {
captions = await getCaptions(currentEpisode.cc);
}
ctx.progress(95);
return {
embeds: [],
stream: [
{
id: 'primary',
playlist: currentEpisode.hls,
type: 'hls',
flags: [flags.CORS_ALLOWED],
captions,
},
],
};
},
async scrapeMovie(ctx) {
const playerData = await ctx.fetcher<string>(`/embed/imdb/${ctx.media.imdbId}`, {
baseUrl: insertUnitBase,
});
ctx.progress(35);
const streamRegex = /hls: "([^"]*)/;
const streamData = streamRegex.exec(playerData);
if (streamData === null || streamData[1] === null) {
throw new NotFoundError('No result found');
}
ctx.progress(75);
const subtitleRegex = /cc: (.*)/;
const subtitleJSONData = subtitleRegex.exec(playerData);
let captions: Caption[] = [];
if (subtitleJSONData != null && subtitleJSONData[1] != null) {
const subtitleData = JSON.parse(subtitleJSONData[1]);
captions = await getCaptions(subtitleData);
}
ctx.progress(90);
return {
embeds: [],
stream: [
{
id: 'primary',
type: 'hls',
playlist: streamData[1],
flags: [flags.CORS_ALLOWED],
captions,
},
],
};
},
});

View File

@@ -0,0 +1,30 @@
export interface Subtitle {
url: string;
name: string;
}
export interface Episode {
episode: string;
id: number;
videoKey: string;
hls: string;
audio: {
names: string[];
order: number[];
};
cc: Subtitle[];
duration: number;
title: string;
download: string;
sections: string[];
poster: string;
preview: {
src: string;
};
}
export interface Season {
season: number;
blocked: boolean;
episodes: Episode[];
}

View File

@@ -19,13 +19,19 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
q: ctx.media.title,
},
});
const show = searchResult.data.items[0];
if (!show) throw new NotFoundError('No watchable item found');
const mediaData = searchResult.data.items.map((movieEl) => {
const name = movieEl.title;
const year = movieEl.contentable.releaseYear;
const fullSlug = movieEl.fullSlug;
return { name, year, fullSlug };
});
const targetMedia = mediaData.find((m) => m.name === ctx.media.title && m.year === ctx.media.releaseYear.toString());
if (!targetMedia?.fullSlug) throw new NotFoundError('No watchable item found');
let iframeSourceUrl = `/${show.fullSlug}/videos`;
let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`;
if (ctx.media.type === 'show') {
const showPageResult = await ctx.proxiedFetcher<string>(`/${show.fullSlug}`, {
const showPageResult = await ctx.proxiedFetcher<string>(`/${targetMedia.fullSlug}`, {
baseUrl: ridoMoviesBase,
});
const fullEpisodeSlug = `season-${ctx.media.season.number}/episode-${ctx.media.episode.number}`;

View File

@@ -42,6 +42,7 @@ export const showboxScraper = makeSourcerer({
id: 'showbox',
name: 'Showbox',
rank: 150,
disabled: true,
flags: [flags.CORS_ALLOWED, flags.CF_BLOCKED],
scrapeShow: comboScraper,
scrapeMovie: comboScraper,

View File

@@ -1,56 +1,29 @@
import { load } from 'cheerio';
import { flags } from '@/entrypoint/utils/targets';
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
import { smashyStreamDScraper } from '@/providers/embeds/smashystream/dued';
import { SourcererOutput, makeSourcerer } from '@/providers/base';
import { smashyStreamOScraper } from '@/providers/embeds/smashystream/opstream';
import { smashyStreamFScraper } from '@/providers/embeds/smashystream/video1';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
const smashyStreamBase = 'https://embed.smashystream.com';
const referer = 'https://smashystream.com/';
const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> => {
const mainPage = await ctx.proxiedFetcher<string>('/playere.php', {
query: {
tmdb: ctx.media.tmdbId,
...(ctx.media.type === 'show' && {
season: ctx.media.season.number.toString(),
episode: ctx.media.episode.number.toString(),
}),
},
headers: {
Referer: referer,
},
baseUrl: smashyStreamBase,
});
ctx.progress(30);
const mainPage$ = load(mainPage);
const sourceUrls = mainPage$('.dropdown-menu a[data-url]')
.map((_, el) => mainPage$(el).attr('data-url'))
.get();
const embeds: SourcererEmbed[] = [];
for (const sourceUrl of sourceUrls) {
if (sourceUrl.includes('video1d.php')) {
embeds.push({
embedId: smashyStreamFScraper.id,
url: sourceUrl,
});
}
if (sourceUrl.includes('dued.php')) {
embeds.push({
embedId: smashyStreamDScraper.id,
url: sourceUrl,
});
}
}
ctx.progress(60);
// theres no point in fetching the player page
// because it too just calls the api with the tmdb id
// thats the only way to find out if the embed has any streams
const query =
ctx.media.type === 'movie'
? `?tmdb=${ctx.media.tmdbId}`
: `?tmdbId=${ctx.media.tmdbId}&season=${ctx.media.season.number}&episode=${ctx.media.episode.number}`;
return {
embeds,
embeds: [
{
embedId: smashyStreamFScraper.id,
url: `https://embed.smashystream.com/video1dn.php${query}`,
},
{
embedId: smashyStreamOScraper.id,
url: `https://embed.smashystream.com/videoop.php${query}`,
},
],
};
};
@@ -59,7 +32,6 @@ export const smashyStreamScraper = makeSourcerer({
name: 'SmashyStream',
rank: 30,
flags: [flags.CORS_ALLOWED],
disabled: true,
scrapeMovie: universalScraper,
scrapeShow: universalScraper,
});

View File

@@ -0,0 +1,120 @@
import { load } from 'cheerio';
import { flags } from '@/entrypoint/utils/targets';
import { Caption, labelToLanguageCode } from '@/providers/captions';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
import { NotFoundError } from '@/utils/errors';
import { InfoResponse } from './types';
import { SourcererOutput, makeSourcerer } from '../../base';
const baseUrl = 'https://soaper.tv';
const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Promise<SourcererOutput> => {
const searchResult = await ctx.proxiedFetcher('/search.html', {
baseUrl,
query: {
keyword: ctx.media.title,
},
});
const searchResult$ = load(searchResult);
let showLink = searchResult$('a')
.filter((_, el) => searchResult$(el).text() === ctx.media.title)
.attr('href');
if (!showLink) throw new NotFoundError('Content not found');
if (ctx.media.type === 'show') {
const seasonNumber = ctx.media.season.number;
const episodeNumber = ctx.media.episode.number;
const showPage = await ctx.proxiedFetcher(showLink, { baseUrl });
const showPage$ = load(showPage);
const seasonBlock = showPage$('h4')
.filter((_, el) => showPage$(el).text().trim().split(':')[0].trim() === `Season${seasonNumber}`)
.parent();
const episodes = seasonBlock.find('a').toArray();
showLink = showPage$(
episodes.find((el) => parseInt(showPage$(el).text().split('.')[0], 10) === episodeNumber),
).attr('href');
}
if (!showLink) throw new NotFoundError('Content not found');
const contentPage = await ctx.proxiedFetcher(showLink, { baseUrl });
const contentPage$ = load(contentPage);
const pass = contentPage$('#hId').attr('value');
const param = contentPage$('#divU').text();
if (!pass || !param) throw new NotFoundError('Content not found');
const formData = new URLSearchParams();
formData.append('pass', pass);
formData.append('param', param);
formData.append('e2', '0');
formData.append('server', '0');
const infoEndpoint = ctx.media.type === 'show' ? '/home/index/getEInfoAjax' : '/home/index/getMInfoAjax';
const streamRes = await ctx.proxiedFetcher<string>(infoEndpoint, {
baseUrl,
method: 'POST',
body: formData,
headers: {
referer: `${baseUrl}${showLink}`,
},
});
const streamResJson: InfoResponse = JSON.parse(streamRes);
const captions: Caption[] = [];
for (const sub of streamResJson.subs) {
// Some subtitles are named <Language>.srt, some are named <LanguageCode>:hi, or just <LanguageCode>
let language: string | null = '';
if (sub.name.includes('.srt')) {
language = labelToLanguageCode(sub.name.split('.srt')[0]);
} else if (sub.name.includes(':')) {
language = sub.name.split(':')[0];
} else {
language = sub.name;
}
if (!language) continue;
captions.push({
id: sub.path,
url: sub.path,
type: 'srt',
hasCorsRestrictions: false,
language,
});
}
return {
embeds: [],
stream: [
{
id: 'primary',
playlist: streamResJson.val,
type: 'hls',
flags: [flags.IP_LOCKED],
captions,
},
...(streamResJson.val_bak
? [
{
id: 'backup',
playlist: streamResJson.val_bak,
type: 'hls' as const,
flags: [flags.IP_LOCKED],
captions,
},
]
: []),
],
};
};
export const soaperTvScraper = makeSourcerer({
id: 'soapertv',
name: 'SoaperTV',
rank: 115,
flags: [flags.IP_LOCKED],
scrapeMovie: universalScraper,
scrapeShow: universalScraper,
});

View File

@@ -0,0 +1,15 @@
export interface Subtitle {
path: string;
name: string;
}
export interface InfoResponse {
key: boolean;
val: string;
vtt: string;
val_bak: string;
pos: number;
type: string;
subs: Subtitle[];
ip: string;
}

View File

@@ -1,2 +1,2 @@
export const vidsrcBase = 'https://vidsrc.me';
export const vidsrcRCPBase = 'https://rcp.vidsrc.me';
export const vidsrcRCPBase = 'https://vidsrc.stream';

View File

@@ -1,4 +1,3 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeSourcerer } from '@/providers/base';
import { scrapeMovie } from '@/providers/sources/vidsrc/scrape-movie';
import { scrapeShow } from '@/providers/sources/vidsrc/scrape-show';
@@ -7,7 +6,7 @@ export const vidsrcScraper = makeSourcerer({
id: 'vidsrc',
name: 'VidSrc',
rank: 90,
flags: [flags.CORS_ALLOWED],
flags: [],
scrapeMovie,
scrapeShow,
});