From cc335863e2658816b09980723ac27f848ce79ec6 Mon Sep 17 00:00:00 2001 From: morpheus65535 Date: Sun, 21 Mar 2021 20:06:58 -0400 Subject: [PATCH] Fixed encoding/escaping of proxy username and password #1327 --- bazarr/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bazarr/config.py b/bazarr/config.py index db5e30849..d38c4d3eb 100644 --- a/bazarr/config.py +++ b/bazarr/config.py @@ -3,6 +3,8 @@ import hashlib import os +from urllib.parse import quote_plus + from subliminal.cache import region from simpleconfigparser import simpleconfigparser @@ -372,8 +374,8 @@ def configure_captcha_func(): def configure_proxy_func(): if settings.proxy.type != 'None': if settings.proxy.username != '' and settings.proxy.password != '': - proxy = settings.proxy.type + '://' + settings.proxy.username + ':' + settings.proxy.password + '@' + \ - settings.proxy.url + ':' + settings.proxy.port + proxy = settings.proxy.type + '://' + quote_plus(settings.proxy.username) + ':' + \ + quote_plus(settings.proxy.password) + '@' + settings.proxy.url + ':' + settings.proxy.port else: proxy = settings.proxy.type + '://' + settings.proxy.url + ':' + settings.proxy.port os.environ['HTTP_PROXY'] = str(proxy)