1
mirror of https://github.com/yt-dlp/yt-dlp synced 2024-12-12 16:03:55 +01:00

[twitch] Fix error message regex

This commit is contained in:
Sergey M․ 2015-07-10 21:15:09 +06:00
parent 008661069b
commit 89a683ae74

View File

@ -74,11 +74,12 @@ class TwitchBaseIE(InfoExtractor):
response = self._download_webpage(
request, None, 'Logging in as %s' % username)
m = re.search(
r"id=([\"'])login_error_message\1[^>]*>(?P<msg>[^<]+)", response)
if m:
error_message = self._search_regex(
r'<div[^>]+class="subwindow_notice"[^>]*>([^<]+)</div>',
response, 'error message', default=None)
if error_message:
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):
try: