From f368538694ef03ac41224223635179314ac425f2 Mon Sep 17 00:00:00 2001 From: lew <139905304+levrx@users.noreply.github.com> Date: Wed, 13 Aug 2025 23:55:45 +0100 Subject: [PATCH] fix rgshows --- src/providers/sources/rgshows.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/providers/sources/rgshows.ts b/src/providers/sources/rgshows.ts index 9fba366..f1757cb 100644 --- a/src/providers/sources/rgshows.ts +++ b/src/providers/sources/rgshows.ts @@ -1,14 +1,15 @@ import { flags } from '@/entrypoint/utils/targets'; import { MovieScrapeContext, ShowScrapeContext } from '@/utils/context'; import { NotFoundError } from '@/utils/errors'; -import { createM3U8ProxyUrl } from '@/utils/proxy'; import { SourcererOutput, makeSourcerer } from '../base'; const baseUrl = 'api.rgshows.me'; + const headers = { referer: 'https://rgshows.me/', origin: 'https://rgshows.me', + host: baseUrl, 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36', }; @@ -23,10 +24,20 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis } const res = await ctx.proxiedFetcher(url, { headers }); - if (!res.stream.url) { + if (!res?.stream?.url) { throw new NotFoundError('No streams found'); } + const streamUrl = res.stream.url; + const streamHost = new URL(streamUrl).host; + + const m3u8Headers = { + ...headers, + host: streamHost, + origin: 'https://www.rgshows.me', + referer: 'https://www.rgshows.me/', + }; + ctx.progress(100); return { @@ -35,7 +46,8 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis { id: 'primary', type: 'hls', - playlist: createM3U8ProxyUrl(res.stream.url, headers), + playlist: streamUrl, + headers: m3u8Headers, flags: [flags.CORS_ALLOWED], captions: [], },