print traceback on trouble if --verbose (why didn't I think of this before!?)
authorFilippo Valsorda <filippo.valsorda@gmail.com>
Tue, 11 Dec 2012 10:02:21 +0000 (11:02 +0100)
committerFilippo Valsorda <filippo.valsorda@gmail.com>
Tue, 11 Dec 2012 10:02:21 +0000 (11:02 +0100)
youtube_dl/FileDownloader.py

index aad12fc1ff7737870335210051a09e15c2af082b..b43acd19b42a1b7ad8b4c8329657864b35b365b3 100644 (file)
@@ -10,6 +10,7 @@ import socket
 import subprocess
 import sys
 import time
+import traceback
 
 if os.name == 'nt':
     import ctypes
@@ -217,6 +218,8 @@ class FileDownloader(object):
         """
         if message is not None:
             self.to_stderr(message)
+        if self.params.get('verbose'):
+            self.to_stderr(u''.join(traceback.format_list(traceback.extract_stack())))
         if not self.params.get('ignoreerrors', False):
             raise DownloadError(message)
         self._download_retcode = 1