mirror of
https://github.com/sussy-code/providers.git
synced 2026-08-15 03:34:13 +00:00
parent
61192a62b1
commit
948150fa1d
1 changed files with 12 additions and 0 deletions
|
|
@ -3,10 +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: getHost(),
|
||||
},
|
||||
},
|
||||
);
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('host', getHost());
|
||||
|
||||
ctx.progress(30);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue