0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-16 01:25:06 +00:00

[mtv] Capture and output error message (#5420)

This commit is contained in:
Sergey M․ 2015-04-15 21:02:34 +06:00
parent 4d1cdb5bfe
commit 0dfe9bc9d2

View file

@ -118,6 +118,14 @@ def _get_video_info(self, itemdoc):
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()