From: Sergey M․ Date: Mon, 11 May 2015 15:31:36 +0000 (+0600) Subject: [zingmp3] Capture error message X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=511565282861e26913caddc1bcc0c865a9eec786;p=youtube-dl [zingmp3] Capture error message --- diff --git a/youtube_dl/extractor/zingmp3.py b/youtube_dl/extractor/zingmp3.py index 1afbe68ed..7dc1e2f2b 100644 --- a/youtube_dl/extractor/zingmp3.py +++ b/youtube_dl/extractor/zingmp3.py @@ -4,12 +4,18 @@ from __future__ import unicode_literals import re from .common import InfoExtractor +from ..utils import ExtractorError class ZingMp3BaseInfoExtractor(InfoExtractor): - @staticmethod - def _extract_item(item): + def _extract_item(self, item): + error_message = item.find('./errormessage').text + if error_message: + raise ExtractorError( + '%s returned error: %s' % (self.IE_NAME, error_message), + expected=True) + title = item.find('./title').text.strip() source = item.find('./source').text extension = item.attrib['type']