aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2021-01-10 06:23:58 +0700
committerSergey M․ <dstftw@gmail.com>2021-01-10 06:23:58 +0700
commit70f572585df5740da90feb518a93f10bb479cca2 (patch)
treea4d752aa3f1bfc10e35c1c01cdf861ed7ef804c0
parentc2d06aef600b2af557d367b9846d79720a3d6725 (diff)
[twitch] Improve login error extraction
-rw-r--r--youtube_dl/extractor/twitch.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index fa19e9a7a..c4fd2f686 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -17,6 +17,7 @@ from ..compat import (
)
from ..utils import (
clean_html,
+ dict_get,
ExtractorError,
float_or_none,
int_or_none,
@@ -83,7 +84,7 @@ class TwitchBaseIE(InfoExtractor):
response = self._download_json(
post_url, None, note, data=json.dumps(form).encode(),
headers=headers, expected_status=400)
- error = response.get('error_description') or response.get('error_code')
+ error = dict_get(response, ('error', 'error_description', 'error_code'))
if error:
fail(error)