Merge branch 'dev' into vidsrc.me

This commit is contained in:
Jorrin 2024-04-07 13:39:59 +02:00 committed by GitHub
commit 7d87e77695
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 6 deletions

View File

@ -6,6 +6,7 @@ title: 'Changelog'
- Fixed VidSrcTo (both Vidplay and Filemoon embeds)
- Added dropload, filelions and vtube embeds to Primewire
- Fixed and enabled Smashystream
- Improved RidoMovies search results
# Version 2.2.8
- Fix package exports for CJS and ESM

View File

@ -1,8 +1,6 @@
import { load } from 'cheerio';
import { unpack } from 'unpacker';
import { flags } from '@/entrypoint/utils/targets';
import { SubtitleResult } from './types';
import { makeEmbed } from '../../base';
import { Caption, getCaptionTypeFromUrl, labelToLanguageCode } from '../../captions';

View File

@ -19,13 +19,19 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) =>
q: ctx.media.title,
},
});
const show = searchResult.data.items[0];
if (!show) throw new NotFoundError('No watchable item found');
const mediaData = searchResult.data.items.map((movieEl) => {
const name = movieEl.title;
const year = movieEl.contentable.releaseYear;
const fullSlug = movieEl.fullSlug;
return { name, year, fullSlug };
});
const targetMedia = mediaData.find((m) => m.name === ctx.media.title && m.year === ctx.media.releaseYear.toString());
if (!targetMedia?.fullSlug) throw new NotFoundError('No watchable item found');
let iframeSourceUrl = `/${show.fullSlug}/videos`;
let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`;
if (ctx.media.type === 'show') {
const showPageResult = await ctx.proxiedFetcher<string>(`/${show.fullSlug}`, {
const showPageResult = await ctx.proxiedFetcher<string>(`/${targetMedia.fullSlug}`, {
baseUrl: ridoMoviesBase,
});
const fullEpisodeSlug = `season-${ctx.media.season.number}/episode-${ctx.media.episode.number}`;