aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-20 21:45:09 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-20 21:45:09 +0600
commit1887ecd4d629f44370846d372155512ec29e1f27 (patch)
tree4b820a6c4b4b1a88948ea852e5011e7e9b25ce88
parentcd32c2caba9e396001adc8aded2dc04617804247 (diff)
[twitch] Fix login
-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 cbdaf9c7a..aad2bf222 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -23,6 +23,7 @@ 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'
_NETRC_MACHINE = 'twitch'
def _handle_error(self, response):
@@ -67,14 +68,14 @@ class TwitchBaseIE(InfoExtractor):
'authenticity_token': authenticity_token,
'redirect_on_login': '',
'embed_form': 'false',
- 'mp_source_action': '',
+ 'mp_source_action': 'login-button',
'follow': '',
- 'user[login]': username,
- 'user[password]': password,
+ 'login': username,
+ 'password': password,
}
request = compat_urllib_request.Request(
- self._LOGIN_URL, compat_urllib_parse.urlencode(login_form).encode('utf-8'))
+ self._LOGIN_POST_URL, compat_urllib_parse.urlencode(login_form).encode('utf-8'))
request.add_header('Referer', self._LOGIN_URL)
response = self._download_webpage(
request, None, 'Logging in as %s' % username)