diff --git a/src/providers/sources/autoembed.ts b/src/providers/sources/autoembed.ts index 549be58..000e1d9 100644 --- a/src/providers/sources/autoembed.ts +++ b/src/providers/sources/autoembed.ts @@ -19,6 +19,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis const fileDataMatch = playerPage.match(/"file": (\[.*?\])/s); if (!fileDataMatch[1]) throw new NotFoundError('No data found'); + ctx.progress(50); const fileData: { title: string; file: string }[] = JSON.parse(fileDataMatch[1].replace(/,\s*\]$/, ']')); @@ -29,6 +30,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis if (!url) continue; embeds.push({ embedId: `autoembed-${stream.title.toLowerCase().trim()}`, url }); } + ctx.progress(90); return { embeds, diff --git a/src/providers/sources/ee3/index.ts b/src/providers/sources/ee3/index.ts index 93c9d9c..87d627b 100644 --- a/src/providers/sources/ee3/index.ts +++ b/src/providers/sources/ee3/index.ts @@ -28,6 +28,7 @@ async function comboScraper(ctx: MovieScrapeContext): Promise { const id = search.find((v) => v && compareMedia(ctx.media, v.title, v.year))?.id; if (!id) throw new NotFoundError('No watchable item found'); + ctx.progress(20); const details: itemDetails = JSON.parse( await ctx.proxiedFetcher('/get', { @@ -40,6 +41,7 @@ async function comboScraper(ctx: MovieScrapeContext): Promise { }), ); if (!details.message.video) throw new Error('Failed to get the stream'); + ctx.progress(40); const keyParams: renewResponse = JSON.parse( await ctx.proxiedFetcher('/renew', { @@ -51,6 +53,7 @@ async function comboScraper(ctx: MovieScrapeContext): Promise { }), ); if (!keyParams.k) throw new Error('Failed to get the key'); + ctx.progress(60); const server = details.message.server === '1' ? 'https://vid.ee3.me/vid/' : 'https://vault.rips.cc/video/'; const k = keyParams.k; @@ -67,6 +70,7 @@ async function comboScraper(ctx: MovieScrapeContext): Promise { language: 'en', }); } + ctx.progress(90); return { embeds: [], diff --git a/src/providers/sources/fsharetv.ts b/src/providers/sources/fsharetv.ts index d921331..ae0ffe4 100644 --- a/src/providers/sources/fsharetv.ts +++ b/src/providers/sources/fsharetv.ts @@ -34,6 +34,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis const watchPageUrl = searchResults.find((x) => x && compareMedia(ctx.media, x.title, x.year))?.url; if (!watchPageUrl) throw new NotFoundError('No watchable item found'); + ctx.progress(50); const watchPage = await ctx.proxiedFetcher(watchPageUrl.replace('/movie', '/w'), { baseUrl }); @@ -67,6 +68,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis }, {} as FileBasedStream['qualities'], ); + ctx.progress(90); return { embeds: [], diff --git a/src/providers/sources/hdrezka/index.ts b/src/providers/sources/hdrezka/index.ts index 8ddb32f..4a232d2 100644 --- a/src/providers/sources/hdrezka/index.ts +++ b/src/providers/sources/hdrezka/index.ts @@ -102,6 +102,7 @@ const universalScraper = async (ctx: ShowScrapeContext | MovieScrapeContext): Pr const { url: streamUrl, subtitle: streamSubtitle } = await getStream(result.id, translatorId, ctx); const parsedVideos = parseVideoLinks(streamUrl); const parsedSubtitles = parseSubtitleLinks(streamSubtitle); + ctx.progress(90); return { embeds: [], diff --git a/src/providers/sources/nepu/index.ts b/src/providers/sources/nepu/index.ts index f8d9b2c..c58fe5d 100644 --- a/src/providers/sources/nepu/index.ts +++ b/src/providers/sources/nepu/index.ts @@ -37,6 +37,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => if (ctx.media.type === 'show') { videoUrl = `${show.url}/season/${ctx.media.season.number}/episode/${ctx.media.episode.number}`; } + ctx.progress(50); const videoPage = await ctx.proxiedFetcher(videoUrl, { baseUrl: nepuBase, @@ -55,6 +56,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => const streamUrl = playerPage.match(/"file":"([^"]+)"/); if (!streamUrl?.[1]) throw new NotFoundError('No stream found.'); + ctx.progress(90); return { embeds: [], diff --git a/src/providers/sources/ridomovies/index.ts b/src/providers/sources/ridomovies/index.ts index e028e22..9944c16 100644 --- a/src/providers/sources/ridomovies/index.ts +++ b/src/providers/sources/ridomovies/index.ts @@ -26,6 +26,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => }); 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'); + ctx.progress(40); let iframeSourceUrl = `/${targetMedia.fullSlug}/videos`; @@ -51,6 +52,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => const iframeSource$ = load(iframeSource.data[0].url); const iframeUrl = iframeSource$('iframe').attr('data-src'); if (!iframeUrl) throw new NotFoundError('No watchable item found'); + ctx.progress(60); const embeds: SourcererEmbed[] = []; if (iframeUrl.includes('closeload')) { @@ -65,6 +67,8 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext) => url: iframeUrl, }); } + ctx.progress(90); + return { embeds, }; diff --git a/src/providers/sources/soapertv/index.ts b/src/providers/sources/soapertv/index.ts index 0bbe25d..19bb87a 100644 --- a/src/providers/sources/soapertv/index.ts +++ b/src/providers/sources/soapertv/index.ts @@ -57,6 +57,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Pr const pass = contentPage$('#hId').attr('value'); if (!pass) throw new NotFoundError('Content not found'); + ctx.progress(50); const formData = new URLSearchParams(); formData.append('pass', pass); @@ -96,6 +97,7 @@ const universalScraper = async (ctx: MovieScrapeContext | ShowScrapeContext): Pr language, }); } + ctx.progress(90); return { embeds: [], diff --git a/src/providers/sources/tugaflix/index.ts b/src/providers/sources/tugaflix/index.ts index a2ef3ef..7b6f1e4 100644 --- a/src/providers/sources/tugaflix/index.ts +++ b/src/providers/sources/tugaflix/index.ts @@ -25,6 +25,7 @@ export const tugaflixScraper = makeSourcerer({ const url = searchResults.find((x) => x && compareMedia(ctx.media, x.title, x.year))?.url; if (!url) throw new NotFoundError('No watchable item found'); + ctx.progress(50); const videoPage = await ctx.proxiedFetcher(url, { method: 'POST', @@ -59,6 +60,7 @@ export const tugaflixScraper = makeSourcerer({ }); } } + ctx.progress(90); return { embeds, @@ -77,6 +79,7 @@ export const tugaflixScraper = makeSourcerer({ const url = searchResults.find((x) => x && compareMedia(ctx.media, x.title, x.year))?.url; if (!url) throw new NotFoundError('No watchable item found'); + ctx.progress(50); const s = ctx.media.season.number < 10 ? `0${ctx.media.season.number}` : ctx.media.season.number.toString(); const e = ctx.media.episode.number < 10 ? `0${ctx.media.episode.number}` : ctx.media.episode.number.toString(); @@ -108,6 +111,7 @@ export const tugaflixScraper = makeSourcerer({ url: finalUrl, }); } + ctx.progress(90); return { embeds, diff --git a/src/providers/sources/vidsrcsu.ts b/src/providers/sources/vidsrcsu.ts index 47b2ad5..a8c2842 100644 --- a/src/providers/sources/vidsrcsu.ts +++ b/src/providers/sources/vidsrcsu.ts @@ -26,6 +26,7 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis .map((x) => x[2]); if (!servers[0]) throw new NotFoundError('No flixhq playlist found'); + ctx.progress(60); return { embeds: [], diff --git a/src/providers/sources/warezcdn/index.ts b/src/providers/sources/warezcdn/index.ts index 7946ae3..8491691 100644 --- a/src/providers/sources/warezcdn/index.ts +++ b/src/providers/sources/warezcdn/index.ts @@ -57,6 +57,7 @@ export const warezcdnScraper = makeSourcerer({ const [, id, servers] = serversPage.match(/let\s+data\s*=\s*'\[\s*\{\s*"id":"([^"]+)".*?"servers":"([^"]+)"/)!; if (!id || !servers) throw new NotFoundError('Failed to find episode id'); + ctx.progress(40); return getEmbeds(id, servers, ctx); }, @@ -67,6 +68,7 @@ export const warezcdnScraper = makeSourcerer({ const seasonsApi = serversPage.match(/var\s+cachedSeasons\s*=\s*"([^"]+)"/)?.[1]; if (!seasonsApi) throw new NotFoundError('Failed to find data'); + ctx.progress(40); const streamsData = await ctx.proxiedFetcher(seasonsApi, { baseUrl: warezcdnBase,