mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-10-31 22:55:26 +00:00
Allow unsetting the proxy with the --proxy option
This commit is contained in:
parent
8027175600
commit
53f72b11e5
1 changed files with 5 additions and 2 deletions
|
@ -392,8 +392,11 @@ def _real_main(argv=None):
|
|||
|
||||
# General configuration
|
||||
cookie_processor = compat_urllib_request.HTTPCookieProcessor(jar)
|
||||
if opts.proxy:
|
||||
proxies = {'http': opts.proxy, 'https': opts.proxy}
|
||||
if opts.proxy is not None:
|
||||
if opts.proxy == '':
|
||||
proxies = {}
|
||||
else:
|
||||
proxies = {'http': opts.proxy, 'https': opts.proxy}
|
||||
else:
|
||||
proxies = compat_urllib_request.getproxies()
|
||||
# Set HTTPS proxy to HTTP one if given (https://github.com/rg3/youtube-dl/issues/805)
|
||||
|
|
Loading…
Reference in a new issue