chore: enforce https:// prefix in mediaflow proxy url and support config without scheme to work aroud elfhosted weirdness

This commit is contained in:
WebStreamr 2026-01-09 14:59:41 +00:00
parent 86eb3d498c
commit da7397fe75
No known key found for this signature in database
2 changed files with 2 additions and 1 deletions

View file

@ -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

View file

@ -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<string, string>): 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}`);