diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-04-15 21:02:34 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-04-15 21:02:34 +0600 |
commit | 0dfe9bc9d286ceb0fd35b0fc8857ba1a86cecdd3 (patch) | |
tree | 34a19e44334df6b8daa17771eb186af34c480c16 /youtube_dl/extractor | |
parent | 4d1cdb5bfebcc93d73ffb710ec7af0752d698dca (diff) |
[mtv] Capture and output error message (#5420)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/mtv.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py index c11de1cb6..4430b3416 100644 --- a/youtube_dl/extractor/mtv.py +++ b/youtube_dl/extractor/mtv.py @@ -118,6 +118,14 @@ class MTVServicesInfoExtractor(InfoExtractor): mediagen_doc = self._download_xml(mediagen_url, video_id, 'Downloading video urls') + item = mediagen_doc.find('./video/item') + if item is not None and item.get('type') == 'text': + message = '%s returned error: ' % self.IE_NAME + if item.get('code') is not None: + message += '%s - ' % item.get('code') + message += item.text + raise ExtractorError(message, expected=True) + description_node = itemdoc.find('description') if description_node is not None: description = description_node.text.strip() |