diff options
author | Philipp Hagemeister <[email protected]> | 2013-06-09 23:43:18 +0200 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2013-06-09 23:43:18 +0200 |
commit | 53f72b11e58a22674476b8695eca13516d11f3eb (patch) | |
tree | 7fb9b92a96957705043423d48602d37168dc3d38 | |
parent | 8027175600c694537cecf0e5de2c6b9de559592b (diff) | |
download | youtube-dl-53f72b11e58a22674476b8695eca13516d11f3eb.tar.gz youtube-dl-53f72b11e58a22674476b8695eca13516d11f3eb.zip |
Allow unsetting the proxy with the --proxy option
-rw-r--r-- | youtube_dl/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 308c48fe6..9279ce776 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -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) |