[atresplayer] Handle invalid_request (auth fail) in handle_error

This commit is contained in:
Ramón Sola 2021-10-04 13:16:00 +02:00
parent 00f4ab1a8d
commit 25aa60a913

View File

@ -53,6 +53,8 @@ class AtresPlayerIE(InfoExtractor):
error = self._parse_json(e.cause.read(), None)
if error.get('error') == 'required_registered':
self.raise_login_required()
if error.get('error') == 'invalid_request':
raise ExtractorError('Authentication failed', expected=True)
raise ExtractorError(error['error_description'], expected=True)
raise
@ -71,8 +73,6 @@ class AtresPlayerIE(InfoExtractor):
'password': password,
}))
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)
def _get_mpd_subtitles(self, mpd_xml, mpd_url):