mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 21:03:18 +00:00
[atresplayer] handle invalid_request response (auth fail) inside handle_error
This commit is contained in:
parent
53edeb4301
commit
09427cd91e
|
@ -47,6 +47,8 @@ def _handle_error(self, e, code):
|
||||||
error = self._parse_json(e.cause.read(), None)
|
error = self._parse_json(e.cause.read(), None)
|
||||||
if error.get('error') == 'required_registered':
|
if error.get('error') == 'required_registered':
|
||||||
self.raise_login_required()
|
self.raise_login_required()
|
||||||
|
if error.get('error') == 'invalid_request':
|
||||||
|
raise ExtractorError('Authentication failed', expected=True)
|
||||||
raise ExtractorError(error['error_description'], expected=True)
|
raise ExtractorError(error['error_description'], expected=True)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
@ -65,8 +67,6 @@ def _login(self):
|
||||||
'password': password,
|
'password': password,
|
||||||
}))
|
}))
|
||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if isinstance(e.cause, compat_HTTPError) and e.cause.code == 400:
|
|
||||||
raise ExtractorError('Authentication failure', expected=True)
|
|
||||||
self._handle_error(e, 400)
|
self._handle_error(e, 400)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
|
Loading…
Reference in a new issue