mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:33:26 +00:00
feat(providers): support remotestream movies
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import { Embed, Sourcerer } from '@/providers/base';
|
||||
import { upcloudScraper } from '@/providers/embeds/upcloud';
|
||||
import { flixhqScraper } from '@/providers/sources/flixhq/index';
|
||||
import { remotreamScraper } from '@/providers/sources/remotestream/index';
|
||||
|
||||
export function gatherAllSources(): Array<Sourcerer> {
|
||||
// all sources are gathered here
|
||||
return [flixhqScraper];
|
||||
return [flixhqScraper, remotreamScraper];
|
||||
}
|
||||
|
||||
export function gatherAllEmbeds(): Array<Embed> {
|
||||
|
@@ -5,22 +5,34 @@ import { NotFoundError } from '@/utils/errors';
|
||||
import { remotestreamBase } from './common';
|
||||
|
||||
// TODO tv shows are available in flixHQ, just no scraper yet
|
||||
export const flixhqScraper = makeSourcerer({
|
||||
export const remotreamScraper = makeSourcerer({
|
||||
id: 'remotestream',
|
||||
name: 'Remote Stream',
|
||||
rank: 55,
|
||||
flags: [flags.NO_CORS],
|
||||
async scrapeShow(ctx) {
|
||||
let playlistLink = `${remotestreamBase}/Movies/${ctx.media.tmdbId}`;
|
||||
|
||||
const seasonNumber = ctx.media.season.number;
|
||||
const episodeNumber = ctx.media.episode.number;
|
||||
|
||||
playlistLink += `/${seasonNumber}/${episodeNumber}/${episodeNumber}.m3u8`;
|
||||
const playlistLink = `${remotestreamBase}/Shows/${ctx.media.tmdbId}/${seasonNumber}/${episodeNumber}/${episodeNumber}.m3u8`;
|
||||
|
||||
const streamRes = await ctx.fetcher<Blob>(playlistLink);
|
||||
if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found');
|
||||
|
||||
return {
|
||||
embeds: [],
|
||||
stream: {
|
||||
playlist: playlistLink,
|
||||
type: 'hls',
|
||||
flags: [flags.NO_CORS],
|
||||
},
|
||||
};
|
||||
},
|
||||
async scrapeMovie(ctx) {
|
||||
const playlistLink = `${remotestreamBase}/Movies/${ctx.media.tmdbId}/${ctx.media.tmdbId}.m3u8`;
|
||||
|
||||
const streamRes = await ctx.fetcher<Blob>(playlistLink);
|
||||
if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found');
|
||||
ctx.progress(90);
|
||||
|
||||
return {
|
||||
embeds: [],
|
||||
|
Reference in New Issue
Block a user