[wat] Capture and output error message
authorSergey M․ <dstftw@gmail.com>
Tue, 23 Sep 2014 12:58:35 +0000 (19:58 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 23 Sep 2014 12:58:35 +0000 (19:58 +0700)
youtube_dl/extractor/wat.py

index 46b4d91330c50b5fb27917a42ef69d07a1a36ad9..268e2f6183405117b7fd10f6037857fa6ce8cf10 100644 (file)
@@ -5,7 +5,10 @@ import re
 import hashlib
 
 from .common import InfoExtractor
-from ..utils import unified_strdate
+from ..utils import (
+    ExtractorError,
+    unified_strdate,
+)
 
 
 class WatIE(InfoExtractor):
@@ -57,6 +60,11 @@ class WatIE(InfoExtractor):
 
         video_info = self.download_video_info(real_id)
 
+        error_desc = video_info.get('error_desc')
+        if error_desc:
+            raise ExtractorError(
+                '%s returned error: %s' % (self.IE_NAME, error_desc), expected=True)
+
         geo_list = video_info.get('geoList')
         country = geo_list[0] if geo_list else ''