Merge pull request #61 from erynith/dev

Fix remotestream base
This commit is contained in:
mrjvs
2024-01-05 19:37:52 +01:00
committed by GitHub

View File

@@ -2,7 +2,7 @@ import { flags } from '@/entrypoint/utils/targets';
import { makeSourcerer } from '@/providers/base'; import { makeSourcerer } from '@/providers/base';
import { NotFoundError } from '@/utils/errors'; import { NotFoundError } from '@/utils/errors';
const remotestreamBase = `https://fsa.remotestre.am`; const remotestreamBase = atob('aHR0cHM6Ly9mc2IuOG1ldDNkdGpmcmNxY2hjb25xcGtsd3hzeGIyb2N1bWMuc3RyZWFt');
export const remotestreamScraper = makeSourcerer({ export const remotestreamScraper = makeSourcerer({
id: 'remotestream', id: 'remotestream',
@@ -16,8 +16,12 @@ export const remotestreamScraper = makeSourcerer({
const playlistLink = `${remotestreamBase}/Shows/${ctx.media.tmdbId}/${seasonNumber}/${episodeNumber}/${episodeNumber}.m3u8`; const playlistLink = `${remotestreamBase}/Shows/${ctx.media.tmdbId}/${seasonNumber}/${episodeNumber}/${episodeNumber}.m3u8`;
ctx.progress(30); ctx.progress(30);
const streamRes = await ctx.fetcher<Blob>(playlistLink); // TODO support blobs in fetchers const streamRes = await ctx.fetcher.full(playlistLink, {
if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found'); 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); ctx.progress(90);
return { return {
@@ -37,8 +41,12 @@ export const remotestreamScraper = makeSourcerer({
const playlistLink = `${remotestreamBase}/Movies/${ctx.media.tmdbId}/${ctx.media.tmdbId}.m3u8`; const playlistLink = `${remotestreamBase}/Movies/${ctx.media.tmdbId}/${ctx.media.tmdbId}.m3u8`;
ctx.progress(30); ctx.progress(30);
const streamRes = await ctx.fetcher<Blob>(playlistLink); const streamRes = await ctx.fetcher.full(playlistLink, {
if (streamRes.type !== 'application/x-mpegurl') throw new NotFoundError('No watchable item found'); 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); ctx.progress(90);
return { return {