[zingmp3] Capture error message
This commit is contained in:
parent
1f92865494
commit
5115652828
@ -4,12 +4,18 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import ExtractorError
|
||||||
|
|
||||||
|
|
||||||
class ZingMp3BaseInfoExtractor(InfoExtractor):
|
class ZingMp3BaseInfoExtractor(InfoExtractor):
|
||||||
|
|
||||||
@staticmethod
|
def _extract_item(self, item):
|
||||||
def _extract_item(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()
|
title = item.find('./title').text.strip()
|
||||||
source = item.find('./source').text
|
source = item.find('./source').text
|
||||||
extension = item.attrib['type']
|
extension = item.attrib['type']
|
||||||
|
Loading…
Reference in New Issue
Block a user