feat(providers): remotestream

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

View File

@ -11,3 +11,30 @@ features:
Todos:
- make default fetcher maker thing work with both undici and node-fetch
providers need to be ported to the new provider repo:
* [ ] superstream
* [x] flixhq
* [ ] gomovies
* [ ] kissasian
* [x] remotestream
embeds:
* [x] upcloud
* [ ] mp4upload
* [ ] playm4u
* [ ] streamm4u
* [ ] streamsb
providers that will not be ported:
* 2embed (disabled)
* gdriveplayer (disabled)
* hdwatched (disabled)
* m4ufree (disabled)
* netfilm (disabled)
* sflix (disabled)
* streamflix (uses flixhq, we already have the content)

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "@movie-web/providers",
"version": "0.0.11",
"version": "0.0.12",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@movie-web/providers",
"version": "0.0.11",
"version": "0.0.12",
"license": "MIT",
"dependencies": {
"cheerio": "^1.0.0-rc.12",

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],
},
};
},
});