Fix remotestream for real

This commit is contained in:
mrjvs 2024-01-05 19:36:26 +01:00
parent 39a6082a19
commit d49c408197
1 changed files with 12 additions and 4 deletions

View File

@ -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<Blob>(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<Blob>(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 {