chore: enforce https:// prefix in mediaflow proxy url and support config without scheme to work aroud elfhosted weirdness
This commit is contained in:
parent
86eb3d498c
commit
da7397fe75
2 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}`);
|
||||
|
|
|
|||
Loading…
Reference in a new issue