projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f16679e
)
[njpwworld] Fix authentication (closes #17427)
author
Sergey M․
<dstftw@gmail.com>
Wed, 31 Oct 2018 18:35:32 +0000
(
01:35
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 31 Oct 2018 18:40:02 +0000
(
01:40
+0700)
youtube_dl/extractor/njpwworld.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/njpwworld.py
b/youtube_dl/extractor/njpwworld.py
index febef097af5f3cb31b2e8c4f7ef1981a7285f88e..025c5d249c4a0daa2032cf639b64c5c27f2974fb 100644
(file)
--- a/
youtube_dl/extractor/njpwworld.py
+++ b/
youtube_dl/extractor/njpwworld.py
@@
-31,6
+31,8
@@
class NJPWWorldIE(InfoExtractor):
'skip': 'Requires login',
}
'skip': 'Requires login',
}
+ _LOGIN_URL = 'https://front.njpwworld.com/auth/login'
+
def _real_initialize(self):
self._login()
def _real_initialize(self):
self._login()
@@
-40,13
+42,17
@@
class NJPWWorldIE(InfoExtractor):
if not username:
return True
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(
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}),
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
# /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
self.report_warning('unable to login')
return False