mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:03:25 +00:00
re-add headers
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { load } from 'cheerio';
|
import { load } from 'cheerio';
|
||||||
|
|
||||||
import { flags } from '@/entrypoint/utils/targets';
|
|
||||||
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
import { SourcererOutput, makeSourcerer } from '@/providers/base';
|
||||||
import { compareTitle } from '@/utils/compare';
|
import { compareTitle } from '@/utils/compare';
|
||||||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||||
@@ -9,6 +8,7 @@ import { NotFoundError } from '@/utils/errors';
|
|||||||
import { SearchResults } from './types';
|
import { SearchResults } from './types';
|
||||||
|
|
||||||
const nepuBase = 'https://nepu.to';
|
const nepuBase = 'https://nepu.to';
|
||||||
|
const nepuReferer = `${nepuBase}/`;
|
||||||
|
|
||||||
const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => {
|
const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => {
|
||||||
const searchResultRequest = await ctx.proxiedFetcher<string>('/ajax/posts', {
|
const searchResultRequest = await ctx.proxiedFetcher<string>('/ajax/posts', {
|
||||||
@@ -63,7 +63,11 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
|
|||||||
captions: [],
|
captions: [],
|
||||||
playlist: streamUrl[1],
|
playlist: streamUrl[1],
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [],
|
||||||
|
headers: {
|
||||||
|
Origin: nepuBase,
|
||||||
|
Referer: nepuReferer,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
} as SourcererOutput;
|
} as SourcererOutput;
|
||||||
@@ -73,7 +77,7 @@ export const nepuScraper = makeSourcerer({
|
|||||||
id: 'nepu',
|
id: 'nepu',
|
||||||
name: 'Nepu',
|
name: 'Nepu',
|
||||||
rank: 111,
|
rank: 111,
|
||||||
flags: [flags.CORS_ALLOWED],
|
flags: [],
|
||||||
scrapeMovie: universalScraper,
|
scrapeMovie: universalScraper,
|
||||||
scrapeShow: universalScraper,
|
scrapeShow: universalScraper,
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user