Merge branch 'dev' into embeds

This commit is contained in:
TPN
2024-04-03 21:26:44 +05:30
committed by GitHub
4 changed files with 9 additions and 7 deletions

View File

@@ -23,7 +23,7 @@ export const fileMoonScraper = makeEmbed({
const embedHtml = load(embedRes); const embedHtml = load(embedRes);
const evalCode = embedHtml('script').text().match(evalCodeRegex); const evalCode = embedHtml('script').text().match(evalCodeRegex);
if (!evalCode) throw new Error('Failed to find eval code'); if (!evalCode) throw new Error('Failed to find eval code');
const unpacked = unpack(evalCode[1]); const unpacked = unpack(evalCode[0]);
const file = fileRegex.exec(unpacked); const file = fileRegex.exec(unpacked);
if (!file?.[1]) throw new Error('Failed to find file'); if (!file?.[1]) throw new Error('Failed to find file');
@@ -53,7 +53,7 @@ export const fileMoonScraper = makeEmbed({
id: 'primary', id: 'primary',
type: 'hls', type: 'hls',
playlist: file[1], playlist: file[1],
flags: [flags.CORS_ALLOWED], flags: [],
captions, captions,
}, },
], ],

View File

@@ -1,4 +1,3 @@
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';
@@ -54,7 +53,11 @@ export const vidplayScraper = makeEmbed({
id: 'primary', id: 'primary',
type: 'hls', type: 'hls',
playlist: source, playlist: source,
flags: [flags.CORS_ALLOWED], flags: [],
headers: {
Referer: url.origin,
Origin: url.origin,
},
captions, captions,
thumbnailTrack, thumbnailTrack,
}, },

View File

@@ -1,7 +1,7 @@
// This file is based on https://github.com/Ciarands/vidsrc-to-resolver/blob/dffa45e726a4b944cb9af0c9e7630476c93c0213/vidsrc.py#L16 // This file is based on https://github.com/Ciarands/vidsrc-to-resolver/blob/dffa45e726a4b944cb9af0c9e7630476c93c0213/vidsrc.py#L16
// Full credits to @Ciarands! // Full credits to @Ciarands!
const DECRYPTION_KEY = '8z5Ag5wgagfsOuhz'; const DECRYPTION_KEY = 'WXrUARXb1aDLaZjI';
export const decodeBase64UrlSafe = (str: string) => { export const decodeBase64UrlSafe = (str: string) => {
const standardizedInput = str.replace(/_/g, '/').replace(/-/g, '+'); const standardizedInput = str.replace(/_/g, '/').replace(/-/g, '+');

View File

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