Update soaperTv

This commit is contained in:
TPN 2024-07-03 13:46:25 +01:00
parent 70127b8588
commit 83ba2bf8d1
No known key found for this signature in database
GPG Key ID: 40AE091637892B91
1 changed files with 10 additions and 9 deletions

View File

@ -1,10 +1,9 @@
import { load } from 'cheerio';
import { flags } from '@/entrypoint/utils/targets';
import { Caption, labelToLanguageCode } from '@/providers/captions';
import { Stream } from '@/providers/streams';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
import { NotFoundError } from '@/utils/errors';
import { convertPlaylistsToDataUrls } from '@/utils/playlist';
import { InfoResponse } from './types';
import { SourcererOutput, makeSourcerer } from '../../base';
@ -89,20 +88,22 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Pr
stream: [
{
id: 'primary',
playlist: await convertPlaylistsToDataUrls(ctx.proxiedFetcher, `${baseUrl}/${streamResJson.val}`),
playlist: `${baseUrl}/${streamResJson.val}`,
type: 'hls',
flags: [flags.CORS_ALLOWED],
proxyDepth: 2,
flags: [],
captions,
},
...(streamResJson.val_bak
? [
{
id: 'backup',
playlist: await convertPlaylistsToDataUrls(ctx.proxiedFetcher, `${baseUrl}/${streamResJson.val_bak}`),
type: 'hls' as const,
flags: [flags.CORS_ALLOWED],
playlist: `${baseUrl}/${streamResJson.val_bak}`,
type: 'hls',
proxyDepth: 2,
flags: [],
captions,
},
} as Stream,
]
: []),
],
@ -113,7 +114,7 @@ export const soaperTvScraper = makeSourcerer({
id: 'soapertv',
name: 'SoaperTV',
rank: 126,
flags: [flags.CORS_ALLOWED],
flags: [],
scrapeMovie: universalScraper,
scrapeShow: universalScraper,
});