diff options
| author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-10-07 21:10:31 +0200 | 
|---|---|---|
| committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-10-07 21:10:31 +0200 | 
| commit | 2ae3edb1cfa5b0afc2e6b6e2d4ea470dadf655a0 (patch) | |
| tree | d1e97866fe8927a91e39915d8becf7f33ceb50ae | |
| parent | b2ad967e4561f0bcb73fca3281341751471cab91 (diff) | |
Fix the printing of the proxy map in debug mode
The proxies have to be extracted from the opener.handlers
| -rw-r--r-- | youtube_dl/__init__.py | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 9594fd892..3ff78daac 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -448,7 +448,7 @@ def _real_main(argv=None):      all_urls = batchurls + args      all_urls = [url.strip() for url in all_urls] -    _setup_opener(jar=jar, opts=opts) +    opener = _setup_opener(jar=jar, opts=opts)      extractors = gen_extractors() @@ -641,7 +641,12 @@ def _real_main(argv=None):              except:                  pass          write_string(u'[debug] Python version %s - %s' %(platform.python_version(), platform_name()) + u'\n') -        write_string(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n') + +        proxy_map = {} +        for handler in opener.handlers: +            if hasattr(handler, 'proxies'): +                proxy_map.update(handler.proxies) +        write_string(u'[debug] Proxy map: ' + compat_str(proxy_map) + u'\n')      ydl.add_default_info_extractors()  | 
