mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	Fix the printing of the proxy map in debug mode
The proxies have to be extracted from the opener.handlers
This commit is contained in:
		@@ -448,7 +448,7 @@ def _real_main(argv=None):
 | 
				
			|||||||
    all_urls = batchurls + args
 | 
					    all_urls = batchurls + args
 | 
				
			||||||
    all_urls = [url.strip() for url in all_urls]
 | 
					    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()
 | 
					    extractors = gen_extractors()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -641,7 +641,12 @@ def _real_main(argv=None):
 | 
				
			|||||||
            except:
 | 
					            except:
 | 
				
			||||||
                pass
 | 
					                pass
 | 
				
			||||||
        write_string(u'[debug] Python version %s - %s' %(platform.python_version(), platform_name()) + u'\n')
 | 
					        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()
 | 
					    ydl.add_default_info_extractors()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user