aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-10 21:15:09 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-10 21:15:09 +0600
commit89a683ae745de77f96ac8e82c8ff16d2675fa398 (patch)
tree2cb9640806fc963b0edc1c668f4df84887c8ce70
parent008661069b0c33614ebdd7c9bcf838256db1b127 (diff)
[twitch] Fix error message regex
-rw-r--r--youtube_dl/extractor/twitch.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index b7a72a7bd..f912d3825 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -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: