feat(providers): remotestream

This commit is contained in:
2023-09-11 22:41:41 -05:00
parent d24146e114
commit ebb7af7123
4 changed files with 64 additions and 2 deletions

View File

@@ -0,0 +1 @@
export const remotestreamBase = `https://fsa.remotestre.am`;

View File

@@ -0,0 +1,34 @@
import { flags } from '@/main/targets';
import { makeSourcerer } from '@/providers/base';
import { NotFoundError } from '@/utils/errors';
import { remotestreamBase } from './common';
// TODO tv shows are available in flixHQ, just no scraper yet
export const flixhqScraper = 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 streamRes = await ctx.fetcher<Blob>(playlistLink);
if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found');
ctx.progress(90);
return {
embeds: [],
stream: {
playlist: playlistLink,
type: 'hls',
flags: [flags.NO_CORS],
},
};
},
});