mirror of
https://github.com/sussy-code/providers.git
synced 2026-08-11 01:27:15 +00:00
parent
75f2370cf8
commit
83d8a7ec27
1 changed files with 8 additions and 1 deletions
|
|
@ -3,15 +3,22 @@ import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base
|
|||
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
|
||||
import { NotFoundError } from '@/utils/errors';
|
||||
|
||||
const getHost = () => {
|
||||
const urlObj = new URL(window.location.href);
|
||||
return `${urlObj.protocol}//${urlObj.host}`;
|
||||
};
|
||||
|
||||
async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promise<SourcererOutput> {
|
||||
const embedPage = await ctx.proxiedFetcher(
|
||||
`https://vidsrc.su/embed/${ctx.media.type === 'movie' ? `movie/${ctx.media.tmdbId}` : `tv/${ctx.media.tmdbId}/${ctx.media.season.number}/${ctx.media.episode.number}`}`,
|
||||
{
|
||||
headers: {
|
||||
Referer: 'https://pstream.org',
|
||||
Referer: getHost(),
|
||||
},
|
||||
},
|
||||
);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('host', getHost());
|
||||
|
||||
ctx.progress(30);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue