From da7397fe75d434aa8a76e1f6ea2443bd631a4ace Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 9 Jan 2026 14:59:41 +0000 Subject: [PATCH] chore: enforce https:// prefix in mediaflow proxy url and support config without scheme to work aroud elfhosted weirdness --- src/landingTemplate.ts | 1 + src/utils/media-flow-proxy.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/landingTemplate.ts b/src/landingTemplate.ts index 1536860..d1124d7 100644 --- a/src/landingTemplate.ts +++ b/src/landingTemplate.ts @@ -238,6 +238,7 @@ export function landingTemplate(manifest: CustomManifest) { } const updateLink = () => { const config = Object.fromEntries(new FormData(mainForm)) + config.mediaFlowProxyUrl = config.mediaFlowProxyUrl.replace(/^https?.\\/\\//, ''); installLink.href = 'stremio://' + window.location.host + '/' + encodeURIComponent(JSON.stringify(config)) + '/manifest.json' } mainForm.onchange = updateLink diff --git a/src/utils/media-flow-proxy.ts b/src/utils/media-flow-proxy.ts index fa538f6..67de59a 100644 --- a/src/utils/media-flow-proxy.ts +++ b/src/utils/media-flow-proxy.ts @@ -11,7 +11,7 @@ interface ExtractResult { export const supportsMediaFlowProxy = (ctx: Context): boolean => !!ctx.config['mediaFlowProxyUrl']; const buildMediaFlowProxyExtractorUrl = (ctx: Context, host: string, url: URL, headers: Record): URL => { - const mediaFlowProxyUrl = new URL('/extractor/video', ctx.config.mediaFlowProxyUrl); + const mediaFlowProxyUrl = new URL('/extractor/video', `https://${ctx.config.mediaFlowProxyUrl?.replace(/^https?.\/\//, '')}`); mediaFlowProxyUrl.searchParams.append('host', host); mediaFlowProxyUrl.searchParams.append('api_password', `${ctx.config.mediaFlowProxyPassword}`);