]> git.bitcoin.ninja Git - youtube-dl/blobdiff - youtube_dl/extractor/funimation.py
[funimation] Remove unnecessary login form field
[youtube-dl] / youtube_dl / extractor / funimation.py
index 773d80fe82e30369fc204123a218e70c1da8b11c..74923c3cf4568f91dbb32abb7453b1d1f77a4e49 100644 (file)
@@ -10,6 +10,7 @@ from ..utils import (
 )
 import re
 
+
 class FunimationIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?funimation\.com/shows/.+[^ ]/videos/official/(?P<id>[^?]+)'
 
@@ -30,20 +31,20 @@ class FunimationIE(InfoExtractor):
             return
         login_url = 'http://www.funimation.com/login'
         data = urlencode_postdata(encode_dict({
-            'loginForm2': 'loginform',
             'email_field': username,
             'password_field': password,
         }))
         login_request = sanitized_Request(login_url, data)
         login_request.add_header('Content-Type', 'application/x-www-form-urlencoded')
         try:
-            login = self._download_webpage(login_request, login_url)
+            login = self._download_webpage(
+                login_request, None, 'Logging in as %s' % username)
         except ExtractorError as e:
             if isinstance(e.cause, compat_HTTPError) and e.cause.code == 403:
                 raise ExtractorError('Funimation is not available in your region.', expected=True)
             raise
         if re.search(r'<meta property="og:url" content="http://www.funimation.com/login"/>', login) is not None:
-                raise ExtractorError('Unable to login, wrong username or password.', expected=True)
+            raise ExtractorError('Unable to login, wrong username or password.', expected=True)
 
     def _real_initialize(self):
         self._login()