1
0
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-12-18 07:26:41 +00:00

Write debugging output to stderr (#1059)

This commit is contained in:
Philipp Hagemeister 2013-07-17 01:30:34 +02:00
parent ffd1833b87
commit f3bab0044e

View File

@ -580,7 +580,7 @@ def _real_main(argv=None):
}) })
if opts.verbose: if opts.verbose:
ydl.to_screen(u'[debug] youtube-dl version ' + __version__) sys.stderr.write(u'[debug] youtube-dl version ' + __version__ + u'\n')
try: try:
sp = subprocess.Popen( sp = subprocess.Popen(
['git', 'rev-parse', '--short', 'HEAD'], ['git', 'rev-parse', '--short', 'HEAD'],
@ -589,11 +589,11 @@ def _real_main(argv=None):
out, err = sp.communicate() out, err = sp.communicate()
out = out.decode().strip() out = out.decode().strip()
if re.match('[0-9a-f]+', out): if re.match('[0-9a-f]+', out):
ydl.to_screen(u'[debug] Git HEAD: ' + out) sys.stderr.write(u'[debug] Git HEAD: ' + out + u'\n')
except: except:
sys.exc_clear() sys.exc_clear()
ydl.to_screen(u'[debug] Python version %s - %s' %(platform.python_version(), platform.platform())) sys.stderr.write(u'[debug] Python version %s - %s' %(platform.python_version(), platform.platform()) + u'\n')
ydl.to_screen(u'[debug] Proxy map: ' + str(proxy_handler.proxies)) sys.stderr.write(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n')
ydl.add_default_info_extractors() ydl.add_default_info_extractors()