mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 12:43:25 +00:00
add headers
This commit is contained in:
@@ -4,6 +4,9 @@ import { flags } from '@/entrypoint/utils/targets';
|
||||
import { makeEmbed } from '@/providers/base';
|
||||
import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '@/providers/captions';
|
||||
|
||||
const origin = 'https://rabbitstream.net';
|
||||
const referer = 'https://rabbitstream.net/';
|
||||
|
||||
const { AES, enc } = crypto;
|
||||
|
||||
interface StreamRes {
|
||||
@@ -126,6 +129,10 @@ export const upcloudScraper = makeEmbed({
|
||||
playlist: sources.file,
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
captions,
|
||||
preferredHeaders: {
|
||||
Referer: referer,
|
||||
Origin: origin,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
@@ -4,6 +4,9 @@ import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
const remotestreamBase = atob('aHR0cHM6Ly9mc2IuOG1ldDNkdGpmcmNxY2hjb25xcGtsd3hzeGIyb2N1bWMuc3RyZWFt');
|
||||
|
||||
const origin = 'https://remotestre.am';
|
||||
const referer = 'https://remotestre.am/';
|
||||
|
||||
export const remotestreamScraper = makeSourcerer({
|
||||
id: 'remotestream',
|
||||
name: 'Remote Stream',
|
||||
@@ -19,6 +22,9 @@ export const remotestreamScraper = makeSourcerer({
|
||||
const streamRes = await ctx.fetcher.full(playlistLink, {
|
||||
method: 'HEAD',
|
||||
readHeaders: ['content-type'],
|
||||
headers: {
|
||||
Referer: referer,
|
||||
},
|
||||
});
|
||||
if (!streamRes.headers.get('content-type')?.toLowerCase().includes('application/x-mpegurl'))
|
||||
throw new NotFoundError('No watchable item found');
|
||||
@@ -33,6 +39,10 @@ export const remotestreamScraper = makeSourcerer({
|
||||
playlist: playlistLink,
|
||||
type: 'hls',
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
preferredHeaders: {
|
||||
Referer: referer,
|
||||
Origin: origin,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -44,6 +54,9 @@ export const remotestreamScraper = makeSourcerer({
|
||||
const streamRes = await ctx.fetcher.full(playlistLink, {
|
||||
method: 'HEAD',
|
||||
readHeaders: ['content-type'],
|
||||
headers: {
|
||||
Referer: referer,
|
||||
},
|
||||
});
|
||||
if (!streamRes.headers.get('content-type')?.toLowerCase().includes('application/x-mpegurl'))
|
||||
throw new NotFoundError('No watchable item found');
|
||||
@@ -58,6 +71,10 @@ export const remotestreamScraper = makeSourcerer({
|
||||
playlist: playlistLink,
|
||||
type: 'hls',
|
||||
flags: [flags.CORS_ALLOWED],
|
||||
preferredHeaders: {
|
||||
Referer: referer,
|
||||
Origin: origin,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
Reference in New Issue
Block a user