1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-23 16:26:40 +00:00

verbose flag, and output proxies if it is set

This commit is contained in:
Philipp Hagemeister 2012-02-26 23:33:19 +01:00
parent 895ec266bb
commit 09fbc6c952

View file

@ -4351,6 +4351,8 @@ def parseOpts():
verbosity.add_option('--console-title', verbosity.add_option('--console-title',
action='store_true', dest='consoletitle', action='store_true', dest='consoletitle',
help='display progress in console titlebar', default=False) help='display progress in console titlebar', default=False)
verbosity.add_option('-v', '--verbose',
action='store_true', dest='verbose', help='print various debugging information', default=False)
filesystem.add_option('-t', '--title', filesystem.add_option('-t', '--title',
@ -4487,10 +4489,14 @@ def _real_main():
# General configuration # General configuration
cookie_processor = urllib2.HTTPCookieProcessor(jar) cookie_processor = urllib2.HTTPCookieProcessor(jar)
opener = urllib2.build_opener(urllib2.ProxyHandler(), cookie_processor, YoutubeDLHandler()) proxy_handler = urllib2.ProxyHandler()
opener = urllib2.build_opener(proxy_handler, cookie_processor, YoutubeDLHandler())
urllib2.install_opener(opener) urllib2.install_opener(opener)
socket.setdefaulttimeout(300) # 5 minutes should be enough (famous last words) socket.setdefaulttimeout(300) # 5 minutes should be enough (famous last words)
if opts.verbose:
print(u'[debug] Proxy map: ' + str(proxy_handler.proxies))
extractors = gen_extractors() extractors = gen_extractors()
if opts.list_extractors: if opts.list_extractors: