-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,17 +119,20 @@ def _real_extract(self, url): | |
|
||
error = video_json.get('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': | ||
self.raise_geo_restricted( | ||
msg=error['message'], countries=self._GEO_COUNTRIES) | ||
self.raise_geo_restricted(message, self._GEO_COUNTRIES) | ||
elif origin == 'NoRedisValidData': | ||
raise ExtractorError('Video %s does not exist' % video_id, expected=True) | ||
elif origin == 'NotAllowedError': | ||
raise ExtractorError('pycryptodome not found. Please install it.', expected=True) | ||
raise ExtractorError( | ||
'Unable to download video %s: %s' % (video_id, error['message']), | ||
expected=True) | ||
extractor_msg = 'Video %s does not exist' | ||
elif message: | ||
if 'недоступен для просмотра на площадке s183' in message: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
remitamine
Author
Collaborator
|
||
raise ExtractorError( | ||
'pycryptodome not found. Please install it.', | ||
expected=True) | ||
extractor_msg += ': ' + message | ||
raise ExtractorError(extractor_msg % video_id, expected=True) | ||
|
||
result = video_json['result'] | ||
title = result['title'] | ||
|
There is still no direct relation between this error message returned by 3rdparty (which may easily change in future) and missing
pycryptodome
. Why overcomplicate this that much when it's easily possible to set flag onImportError
and ust check this flag.