From 27e1ae7e0b406964f2c775dcb812349ee89c5165 Mon Sep 17 00:00:00 2001 From: erynith <135774005+erynith@users.noreply.github.com> Date: Tue, 2 Jan 2024 13:54:13 -0500 Subject: [PATCH 1/2] Fix remotestream base --- src/providers/sources/remotestream.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/providers/sources/remotestream.ts b/src/providers/sources/remotestream.ts index 6d0a44c..d358899 100644 --- a/src/providers/sources/remotestream.ts +++ b/src/providers/sources/remotestream.ts @@ -2,7 +2,7 @@ import { flags } from '@/entrypoint/utils/targets'; import { makeSourcerer } from '@/providers/base'; import { NotFoundError } from '@/utils/errors'; -const remotestreamBase = `https://fsa.remotestre.am`; +const remotestreamBase = atob('aHR0cHM6Ly9mc2IuOG1ldDNkdGpmcmNxY2hjb25xcGtsd3hzeGIyb2N1bWMuc3RyZWFt'); export const remotestreamScraper = makeSourcerer({ id: 'remotestream', From d49c4081975f9dd0d5b6d86c9ac77bcc97966523 Mon Sep 17 00:00:00 2001 From: mrjvs Date: Fri, 5 Jan 2024 19:36:26 +0100 Subject: [PATCH 2/2] Fix remotestream for real --- src/providers/sources/remotestream.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/providers/sources/remotestream.ts b/src/providers/sources/remotestream.ts index d358899..8a3090b 100644 --- a/src/providers/sources/remotestream.ts +++ b/src/providers/sources/remotestream.ts @@ -16,8 +16,12 @@ export const remotestreamScraper = makeSourcerer({ const playlistLink = `${remotestreamBase}/Shows/${ctx.media.tmdbId}/${seasonNumber}/${episodeNumber}/${episodeNumber}.m3u8`; ctx.progress(30); - const streamRes = await ctx.fetcher(playlistLink); // TODO support blobs in fetchers - if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found'); + const streamRes = await ctx.fetcher.full(playlistLink, { + method: 'HEAD', + readHeaders: ['content-type'], + }); + if (!streamRes.headers.get('content-type')?.toLowerCase().includes('application/x-mpegurl')) + throw new NotFoundError('No watchable item found'); ctx.progress(90); return { @@ -37,8 +41,12 @@ export const remotestreamScraper = makeSourcerer({ const playlistLink = `${remotestreamBase}/Movies/${ctx.media.tmdbId}/${ctx.media.tmdbId}.m3u8`; ctx.progress(30); - const streamRes = await ctx.fetcher(playlistLink); - if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found'); + const streamRes = await ctx.fetcher.full(playlistLink, { + method: 'HEAD', + readHeaders: ['content-type'], + }); + if (!streamRes.headers.get('content-type')?.toLowerCase().includes('application/x-mpegurl')) + throw new NotFoundError('No watchable item found'); ctx.progress(90); return {