[ivi] improve error detection
This commit is contained in:
parent
6c79785bb0
commit
9e4e864639
1 changed files with 12 additions and 9 deletions
|
@ -119,17 +119,20 @@ class IviIE(InfoExtractor):
|
||||||
|
|
||||||
error = video_json.get('error')
|
error = video_json.get('error')
|
||||||
if error:
|
if error:
|
||||||
origin = error['origin']
|
origin = error.get('origin')
|
||||||
|
message = error.get('message') or error.get('user_message')
|
||||||
|
extractor_msg = 'Unable to download video %s'
|
||||||
if origin == 'NotAllowedForLocation':
|
if origin == 'NotAllowedForLocation':
|
||||||
self.raise_geo_restricted(
|
self.raise_geo_restricted(message, self._GEO_COUNTRIES)
|
||||||
msg=error['message'], countries=self._GEO_COUNTRIES)
|
|
||||||
elif origin == 'NoRedisValidData':
|
elif origin == 'NoRedisValidData':
|
||||||
raise ExtractorError('Video %s does not exist' % video_id, expected=True)
|
extractor_msg = 'Video %s does not exist'
|
||||||
elif origin == 'NotAllowedError':
|
elif message:
|
||||||
raise ExtractorError('pycryptodome not found. Please install it.', expected=True)
|
if 'недоступен для просмотра на площадке s183' in message:
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'Unable to download video %s: %s' % (video_id, error['message']),
|
'pycryptodome not found. Please install it.',
|
||||||
expected=True)
|
expected=True)
|
||||||
|
extractor_msg += ': ' + message
|
||||||
|
raise ExtractorError(extractor_msg % video_id, expected=True)
|
||||||
|
|
||||||
result = video_json['result']
|
result = video_json['result']
|
||||||
title = result['title']
|
title = result['title']
|
||||||
|
|
Loading…
Reference in a new issue