From 25aa60a913bdc2904574bc54f84dabb783e82a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Sola?= Date: Mon, 4 Oct 2021 13:16:00 +0200 Subject: [PATCH] [atresplayer] Handle invalid_request (auth fail) in handle_error --- youtube_dl/extractor/atresplayer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/atresplayer.py b/youtube_dl/extractor/atresplayer.py index 178514767..a9ac4a669 100644 --- a/youtube_dl/extractor/atresplayer.py +++ b/youtube_dl/extractor/atresplayer.py @@ -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):