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