X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Ftwitch.py;h=f912d3825e65046e33068f34aafce63eaa07f235;hb=89a683ae745de77f96ac8e82c8ff16d2675fa398;hp=b56ee2959cd92c3bb26ca57c471c049236ea63ca;hpb=804ad79985bf2cc7d04547d4c8fcfa4d7234222f;p=youtube-dl diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py index b56ee2959..f912d3825 100644 --- a/youtube_dl/extractor/twitch.py +++ b/youtube_dl/extractor/twitch.py @@ -22,8 +22,8 @@ class TwitchBaseIE(InfoExtractor): _API_BASE = 'https://api.twitch.tv' _USHER_BASE = 'http://usher.twitch.tv' - _LOGIN_URL = 'https://secure.twitch.tv/user/login' - _LOGIN_POST_URL = 'https://secure-login.twitch.tv/login' + _LOGIN_URL = 'https://secure.twitch.tv/login' + _LOGIN_POST_URL = 'https://passport.twitch.tv/authorize' _NETRC_MACHINE = 'twitch' def _handle_error(self, response): @@ -59,20 +59,14 @@ class TwitchBaseIE(InfoExtractor): login_page = self._download_webpage( self._LOGIN_URL, None, 'Downloading login page') - authenticity_token = self._search_regex( - r']*>(?P[^<]+)", response) - if m: + error_message = self._search_regex( + r']+class="subwindow_notice"[^>]*>([^<]+)', + 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: