Skip to content

Commit d52dd3d

Browse files
committed
Fix fsharetv
istg the ext is so broken
1 parent 276620b commit d52dd3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/providers/sources/fsharetv.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ async function comboScraper(ctx: ShowScrapeContext | MovieScrapeContext): Promis
5151
);
5252
if (!apiRes.data.file.sources.length) throw new Error('No sources found');
5353

54+
// this is to get around a ext bug where it doesn't send the headers to the second req after redir
55+
const mediaBase = new URL((await ctx.proxiedFetcher.full(apiRes.data.file.sources[0].src, { baseUrl })).finalUrl)
56+
.origin;
57+
5458
const qualities = apiRes.data.file.sources.reduce(
5559
(acc, source) => {
5660
const quality = typeof source.quality === 'number' ? source.quality.toString() : source.quality;
5761
const validQuality = getValidQualityFromString(quality);
5862
acc[validQuality] = {
5963
type: 'mp4',
60-
url: `${baseUrl}${source.src}`,
64+
url: `${mediaBase}${source.src.replace('/api', '')}`,
6165
};
6266
return acc;
6367
},

0 commit comments

Comments
 (0)