diff options
author | Sergey M․ <dstftw@gmail.com> | 2014-06-08 23:05:20 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2014-06-08 23:05:20 +0700 |
commit | 09ffa08ba1d65cb2ae6912053dd62ada9fd4ef24 (patch) | |
tree | 3b6beb74e25d36a9c8b36fde061855d98ce0256f | |
parent | e0b4cc489fea7346a3149f003b4fab7ba3bc5916 (diff) |
[veoh] Capture error message
-rw-r--r-- | youtube_dl/extractor/veoh.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/extractor/veoh.py b/youtube_dl/extractor/veoh.py index d16993daf..fb132aef6 100644 --- a/youtube_dl/extractor/veoh.py +++ b/youtube_dl/extractor/veoh.py @@ -7,6 +7,7 @@ from .common import InfoExtractor from ..utils import ( compat_urllib_request, int_or_none, + ExtractorError, ) @@ -94,8 +95,12 @@ class VeohIE(InfoExtractor): if video_id.startswith('v'): rsp = self._download_xml( r'http://www.veoh.com/api/findByPermalink?permalink=%s' % video_id, video_id, 'Downloading video XML') - if rsp.get('stat') == 'ok': + stat = rsp.get('stat') + if stat == 'ok': return self._extract_video(rsp.find('./videoList/video')) + elif stat == 'fail': + raise ExtractorError( + '%s said: %s' % (self.IE_NAME, rsp.find('./errorList/error').get('errorMessage')), expected=True) webpage = self._download_webpage(url, video_id) age_limit = 0 |