aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/zingmp3.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-05-11 21:31:36 +0600
committerSergey M․ <dstftw@gmail.com>2015-05-11 21:31:36 +0600
commit511565282861e26913caddc1bcc0c865a9eec786 (patch)
tree7eee71680fddf9b3100c1ba75cb06db8f13992f2 /youtube_dl/extractor/zingmp3.py
parent1f92865494c6efa1a0d5d90ffa849e85b80c8248 (diff)
[zingmp3] Capture error message
Diffstat (limited to 'youtube_dl/extractor/zingmp3.py')
-rw-r--r--youtube_dl/extractor/zingmp3.py10
1 files changed, 8 insertions, 2 deletions
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']