ahhh fixed soaper

This commit is contained in:
Pas 2025-05-24 12:21:43 -06:00
parent 80e8916a66
commit 1e6693e4b1
2 changed files with 20 additions and 12 deletions

View file

@ -6,7 +6,7 @@ import { Stream } from '@/providers/streams';
import { compareMedia } from '@/utils/compare';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
import { NotFoundError } from '@/utils/errors';
import { convertPlaylistsToDataUrls } from '@/utils/playlist';
import { createM3U8ProxyUrl } from '@/utils/proxy';
import { InfoResponse } from './types';
import { SourcererOutput, makeSourcerer } from '../../base';
@ -104,16 +104,20 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Pr
}
ctx.progress(90);
// Headers needed for the M3U8 proxy
const headers = {
referer: `${baseUrl}${showLink}`,
'User-Agent':
'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1',
'Viewport-Width': '375',
};
return {
embeds: [],
stream: [
{
id: 'primary',
playlist: await convertPlaylistsToDataUrls(ctx.proxiedFetcher, `${baseUrl}/${streamResJson.val}`, {
'User-Agent':
'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1',
'Viewport-Width': '375',
}),
playlist: createM3U8ProxyUrl(`${baseUrl}/${streamResJson.val}`, headers),
type: 'hls',
proxyDepth: 2,
flags: [flags.CORS_ALLOWED],
@ -123,11 +127,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Pr
? [
{
id: 'backup',
playlist: await convertPlaylistsToDataUrls(ctx.proxiedFetcher, `${baseUrl}/${streamResJson.val_bak}`, {
'User-Agent':
'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1',
'Viewport-Width': '375',
}),
playlist: createM3U8ProxyUrl(`${baseUrl}/${streamResJson.val_bak}`, headers),
type: 'hls',
flags: [flags.CORS_ALLOWED],
proxyDepth: 2,
@ -144,7 +144,13 @@ export const soaperTvScraper = makeSourcerer({
name: 'SoaperTV',
rank: 130,
disabled: false,
flags: [flags.CORS_ALLOWED, flags.IP_LOCKED],
flags: [flags.CORS_ALLOWED],
scrapeMovie: universalScraper,
scrapeShow: universalScraper,
});
// playlist: await convertPlaylistsToDataUrls(ctx.proxiedFetcher, `${baseUrl}/${streamResJson.val_bak}`, {
// 'User-Agent':
// 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1',
// 'Viewport-Width': '375',
// }),

View file

@ -43,6 +43,7 @@ import {
xprimeVolkswagenEmbed,
} from '@/providers/embeds/xprime';
import { embedsuScraper } from '@/providers/sources/embedsu';
import { soaperTvScraper } from '@/providers/sources/soapertv';
import { uiraliveScraper } from '@/providers/sources/uiralive';
import { wecimaScraper } from '@/providers/sources/wecima';
import { Stream } from '@/providers/streams';
@ -91,6 +92,7 @@ const SKIP_VALIDATION_CHECK_IDS = [
oneServerAnizoneEmbed.id,
wecimaScraper.id,
...cinemaosHexaEmbeds.map((e) => e.id),
soaperTvScraper.id,
];
export function isValidStream(stream: Stream | undefined): boolean {