mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-23 23:38:44 +00:00
Fixed encoding/escaping of proxy username and password #1327
This commit is contained in:
parent
01b1fda8fc
commit
cc335863e2
1 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue