1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-20 18:23:03 +08:00

[xiami] raise expressive error thrown by vendor (#24)

Avoid confusing error message.
This commit is contained in:
Fai 2020-11-03 12:26:13 +08:00 committed by GitHub
parent 8106dc7cd5
commit 1b39e948fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote
from ..utils import int_or_none
from ..utils import int_or_none, ExtractorError
class XiamiBaseIE(InfoExtractor):
@ -46,6 +46,8 @@ class XiamiBaseIE(InfoExtractor):
item_id, headers={
'Referer': referer,
})
if 'message' in playlist and playlist['message']:
raise ExtractorError(playlist['message'], expected=True)
return [
self._extract_track(track, item_id)
for track in playlist['data']['trackList']]