1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 16:57:40 +00:00

[twitch] Improve login error extraction

This commit is contained in:
Sergey M․ 2021-01-10 06:23:58 +07:00
parent c2d06aef60
commit 70f572585d
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -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)