]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[twitch] Use `_form_hidden_inputs` when logging in
authorSergey M․ <dstftw@gmail.com>
Fri, 10 Jul 2015 15:49:39 +0000 (21:49 +0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 10 Jul 2015 15:49:39 +0000 (21:49 +0600)
youtube_dl/extractor/twitch.py

index 49535cd80c8183be556aed196094e322ceb41574..af2b798fb41467ddb7c6db1a82f2a6d7e940ec30 100644 (file)
@@ -59,9 +59,7 @@ class TwitchBaseIE(InfoExtractor):
         login_page = self._download_webpage(
             self._LOGIN_URL, None, 'Downloading login page')
 
-        login_form = dict(re.findall(
-            r'<input\s+type="hidden"\s+name="([^"]+)"\s+(?:id="[^"]+"\s+)?value="([^"]*)"',
-            login_page))
+        login_form = self._form_hidden_inputs(login_page)
 
         login_form.update({
             'login': username.encode('utf-8'),