mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-23 09:17:48 +00:00
[twitch] Fix error message regex
This commit is contained in:
parent
008661069b
commit
89a683ae74
1 changed files with 5 additions and 4 deletions
|
@ -74,11 +74,12 @@ class TwitchBaseIE(InfoExtractor):
|
||||||
response = self._download_webpage(
|
response = self._download_webpage(
|
||||||
request, None, 'Logging in as %s' % username)
|
request, None, 'Logging in as %s' % username)
|
||||||
|
|
||||||
m = re.search(
|
error_message = self._search_regex(
|
||||||
r"id=([\"'])login_error_message\1[^>]*>(?P<msg>[^<]+)", response)
|
r'<div[^>]+class="subwindow_notice"[^>]*>([^<]+)</div>',
|
||||||
if m:
|
response, 'error message', default=None)
|
||||||
|
if error_message:
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
'Unable to login: %s' % m.group('msg').strip(), expected=True)
|
'Unable to login. Twitch said: %s' % error_message, expected=True)
|
||||||
|
|
||||||
def _prefer_source(self, formats):
|
def _prefer_source(self, formats):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue