remove uira embeds

This commit is contained in:
Pas 2025-02-25 09:37:18 -07:00
parent e057d5706d
commit 2ed8f6cfa9
3 changed files with 13 additions and 109 deletions

View file

@ -57,17 +57,6 @@ import { smashyStreamOScraper } from './embeds/smashystream/opstream';
import { smashyStreamFScraper } from './embeds/smashystream/video1';
import { streamtapeScraper } from './embeds/streamtape';
import { streamvidScraper } from './embeds/streamvid';
import {
uiraCatflixScraper,
uiraFlickyScraper,
uiraFlixhqScraper,
uiraMegaScraper,
uiraOrionScraper,
uiraRabbitScraper,
uiraSlidemoviesScraper,
uiraVidapiScraper,
uiraVidsrcvipScraper,
} from './embeds/uiralive';
import { vidCloudScraper } from './embeds/vidcloud';
import { vidplayScraper } from './embeds/vidplay';
import {
@ -224,14 +213,5 @@ export function gatherAllEmbeds(): Array<Embed> {
webtor720Scraper,
webtor480Scraper,
viperScraper,
uiraCatflixScraper,
uiraMegaScraper,
uiraRabbitScraper,
uiraOrionScraper,
uiraVidsrcvipScraper,
uiraFlixhqScraper,
uiraSlidemoviesScraper,
uiraVidapiScraper,
uiraFlickyScraper,
];
}

View file

@ -1,80 +0,0 @@
import { flags } from '@/entrypoint/utils/targets';
import { makeEmbed } from '@/providers/base';
const providers = [
{
id: 'uira-catflix',
rank: 309,
},
{
id: 'uira-mega',
rank: 308,
},
{
id: 'uira-rabbit',
rank: 307,
},
{
id: 'uira-orion',
rank: 306,
},
{
id: 'uira-vidsrcvip',
rank: 305,
},
{
id: 'uira-flixhq',
rank: 304,
},
{
id: 'uira-slidemovies',
rank: 303,
},
{
id: 'uira-vidapi',
rank: 302,
},
{
id: 'uira-flicky',
rank: 301,
},
];
function embed(provider: { id: string; rank: number; name?: string; disabled?: boolean }) {
return makeEmbed({
id: provider.id,
name:
provider.name ||
provider.id
.split('-')
.map((word) => word[0].toUpperCase() + word.slice(1))
.join(' '),
disabled: provider.disabled,
rank: provider.rank,
async scrape(ctx) {
return {
stream: [
{
id: 'primary',
type: 'hls',
playlist: ctx.url,
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
},
});
}
export const [
uiraCatflixScraper,
uiraMegaScraper,
uiraRabbitScraper,
uiraOrionScraper,
uiraVidsrcvipScraper,
uiraFlixhqScraper,
uiraSlidemoviesScraper,
uiraVidapiScraper,
uiraFlickyScraper,
] = providers.map(embed);

View file

@ -1,5 +1,5 @@
import { flags } from '@/entrypoint/utils/targets';
import { SourcererEmbed, SourcererOutput, makeSourcerer } from '@/providers/base';
import { SourcererOutput, makeSourcerer } from '@/providers/base';
import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context';
import { NotFoundError } from '@/utils/errors';
@ -13,7 +13,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
let result = await ctx.fetcher(fetchUrl);
if (!result?.sources?.length) {
if (!result?.sources || result.sources.length === 0) {
try {
result = await ctx.fetcher(fetchUrl);
} catch (e: any) {
@ -22,17 +22,21 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
}
}
if (!result?.sources?.length) throw new NotFoundError('No sources found');
const embeds: SourcererEmbed[] = result.sources.map((source: { source: any; url: any }) => ({
embedId: `uira-${source.source}`,
url: source.url,
}));
if (!result?.sources || result.sources.length === 0) throw new NotFoundError('No sources found');
ctx.progress(90);
return {
embeds,
embeds: [],
stream: [
{
id: 'primary',
playlist: result.sources[0].url,
type: 'hls',
flags: [flags.CORS_ALLOWED],
captions: [],
},
],
};
}