mirror of
https://github.com/p-stream/providers.git
synced 2026-01-11 20:10:33 +00:00
add RGShows
thanks Lew!
This commit is contained in:
parent
624611103c
commit
193d769442
2 changed files with 55 additions and 0 deletions
|
|
@ -69,6 +69,7 @@ import { iosmirrorScraper } from './sources/iosmirror';
|
|||
import { iosmirrorPVScraper } from './sources/iosmirrorpv';
|
||||
import { madplayScraper } from './sources/madplay';
|
||||
import { nunflixScraper } from './sources/nunflix';
|
||||
import { rgshowsScraper } from './sources/rgshows';
|
||||
import { ridooMoviesScraper } from './sources/ridomovies';
|
||||
import { slidemoviesScraper } from './sources/slidemovies';
|
||||
import { soaperTvScraper } from './sources/soapertv';
|
||||
|
|
@ -111,6 +112,7 @@ export function gatherAllSources(): Array<Sourcerer> {
|
|||
pirxcyScraper,
|
||||
vidsrcvipScraper,
|
||||
madplayScraper,
|
||||
rgshowsScraper,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
53
src/providers/sources/rgshows.ts
Normal file
53
src/providers/sources/rgshows.ts
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import { flags } from '@/entrypoint/utils/targets';
|
||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
import { createM3U8ProxyUrl } from '@/utils/proxy';
|
||||
|
||||
import { SourcererOutput, makeSourcerer } from '../base';
|
||||
|
||||
const baseUrl = 'api.rgshows.me';
|
||||
const headers = {
|
||||
referer: 'https://rgshows.me/',
|
||||
origin: 'https://rgshows.me',
|
||||
'User-Agent':
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
|
||||
};
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
let url = `https://${baseUrl}/main`;
|
||||
|
||||
if (ctx.media.type === 'movie') {
|
||||
url += `/movie/${ctx.media.tmdbId}`;
|
||||
} else if (ctx.media.type === 'show') {
|
||||
url += `/tv/${ctx.media.tmdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`;
|
||||
}
|
||||
|
||||
const res = await ctx.proxiedFetcher(url, { headers });
|
||||
if (!res.stream.url) {
|
||||
throw new NotFoundError('No streams found');
|
||||
}
|
||||
|
||||
ctx.progress(100);
|
||||
|
||||
return {
|
||||
embeds: [],
|
||||
stream: [
|
||||
{
|
||||
id: 'primary',
|
||||
type: 'hls',
|
||||
playlist: createM3U8ProxyUrl(res.stream.url, headers),
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions: [],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
export const rgshowsScraper = makeSourcerer({
|
||||
id: 'rgshows',
|
||||
name: 'RGShows',
|
||||
rank: 173,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
scrapeMovie: comboScraper,
|
||||
scrapeShow: comboScraper,
|
||||
});
|
||||
Loading…
Reference in a new issue