aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2012-02-26 23:33:19 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2012-02-26 23:33:19 +0100
commit09fbc6c952ddb42ff042c2911576102dc8e78e23 (patch)
tree21d7968eb8449beaba13643b6690446306a4fda0
parent895ec266bbcd40ecbc755e4efd130be380809d8a (diff)
verbose flag, and output proxies if it is set
-rwxr-xr-xyoutube_dl/__init__.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index 52da3b859..4c9c237d9 100755
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -4351,6 +4351,8 @@ def parseOpts():
verbosity.add_option('--console-title',
action='store_true', dest='consoletitle',
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',
@@ -4487,10 +4489,14 @@ def _real_main():
# General configuration
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)
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()
if opts.list_extractors: