aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-11-01 01:35:32 +0700
committerSergey M․ <dstftw@gmail.com>2018-11-01 01:40:02 +0700
commitc70ba664f19f0323d74e4e8ea76249f4c97def06 (patch)
treeebe02ee9bef30a83608e5e237a44a37f22086741
parentf16679e8436fb0e9d01aca2343ce22a01802667f (diff)
downloadyoutube-dl-c70ba664f19f0323d74e4e8ea76249f4c97def06.tar.xz
[njpwworld] Fix authentication (closes #17427)
-rw-r--r--youtube_dl/extractor/njpwworld.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/youtube_dl/extractor/njpwworld.py b/youtube_dl/extractor/njpwworld.py
index febef097a..025c5d249 100644
--- a/youtube_dl/extractor/njpwworld.py
+++ b/youtube_dl/extractor/njpwworld.py
@@ -31,6 +31,8 @@ class NJPWWorldIE(InfoExtractor):
'skip': 'Requires login',
}
+ _LOGIN_URL = 'https://front.njpwworld.com/auth/login'
+
def _real_initialize(self):
self._login()
@@ -40,13 +42,17 @@ class NJPWWorldIE(InfoExtractor):
if not username:
return True
+ # Setup session (will set necessary cookies)
+ self._request_webpage(
+ 'https://njpwworld.com/', None, note='Setting up session')
+
webpage, urlh = self._download_webpage_handle(
- 'https://njpwworld.com/auth/login', None,
+ self._LOGIN_URL, None,
note='Logging in', errnote='Unable to login',
data=urlencode_postdata({'login_id': username, 'pw': password}),
- headers={'Referer': 'https://njpwworld.com/auth'})
+ headers={'Referer': 'https://front.njpwworld.com/auth'})
# /auth/login will return 302 for successful logins
- if urlh.geturl() == 'https://njpwworld.com/auth/login':
+ if urlh.geturl() == self._LOGIN_URL:
self.report_warning('unable to login')
return False