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