0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-29 03:23:02 +00:00

[dailymotion] Raise ExtractorError if the dailymotion response reports an error

This commit is contained in:
Jaime Marquínez Ferrándiz 2013-09-21 12:15:54 +02:00
parent 34308b30d6
commit 3a1d48d6de

View file

@ -63,6 +63,9 @@ def _real_extract(self, url):
info = self._search_regex(r'var info = ({.*?}),$', embed_page, info = self._search_regex(r'var info = ({.*?}),$', embed_page,
'video info', flags=re.MULTILINE) 'video info', flags=re.MULTILINE)
info = json.loads(info) info = json.loads(info)
if info.get('error') is not None:
msg = 'Couldn\'t get video, Dailymotion says: %s' % info['error']['title']
raise ExtractorError(msg, expected=True)
# TODO: support choosing qualities # TODO: support choosing qualities