add cors allowed flags

This commit is contained in:
Jorrin
2024-03-14 20:45:40 +01:00
parent 44686f76de
commit db4a27e51a
3 changed files with 7 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import { unpack } from 'unpacker';
import { SubtitleResult } from './types';
import { flags } from '../../../../lib';
import { makeEmbed } from '../../base';
import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '../../captions';
@@ -49,7 +50,7 @@ export const fileMoonScraper = makeEmbed({
id: 'primary',
type: 'hls',
playlist: file[1],
flags: [],
flags: [flags.CORS_ALLOWED],
captions,
},
],

View File

@@ -1,7 +1,8 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '@/providers/captions';
import { getFileUrl, referer } from './common';
import { getFileUrl } from './common';
import { SubtitleResult, VidplaySourceResponse } from './types';
export const vidplayScraper = makeEmbed({
@@ -44,12 +45,8 @@ export const vidplayScraper = makeEmbed({
id: 'primary',
type: 'hls',
playlist: source,
flags: [],
flags: [flags.CORS_ALLOWED],
captions,
preferredHeaders: {
Referer: referer,
Origin: referer,
},
},
],
};

View File

@@ -1,5 +1,6 @@
import { load } from 'cheerio';
import { flags } from '@/entrypoint/utils/targets';
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
@@ -77,6 +78,6 @@ export const vidSrcToScraper = makeSourcerer({
name: 'VidSrcTo',
scrapeMovie: universalScraper,
scrapeShow: universalScraper,
flags: [],
flags: [flags.CORS_ALLOWED],
rank: 300,
});