mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 20:22:36 +01:00
[exhentai] store more cookies when logging in (#4881)
include 'igneous', 'hath_perks', etc and not just 'ipb_member_id' and 'ipb_pass_hash' like before
This commit is contained in:
parent
ad0134daf7
commit
da0da0faaa
@ -85,6 +85,7 @@ class ExhentaiExtractor(Extractor):
|
||||
@cache(maxage=90*24*3600, keyarg=1)
|
||||
def _login_impl(self, username, password):
|
||||
self.log.info("Logging in as %s", username)
|
||||
|
||||
url = "https://forums.e-hentai.org/index.php?act=Login&CODE=01"
|
||||
headers = {
|
||||
"Referer": "https://e-hentai.org/bounce_login.php?b=d&bt=1-1",
|
||||
@ -98,10 +99,19 @@ class ExhentaiExtractor(Extractor):
|
||||
"ipb_login_submit": "Login!",
|
||||
}
|
||||
|
||||
self.cookies.clear()
|
||||
|
||||
response = self.request(url, method="POST", headers=headers, data=data)
|
||||
if b"You are now logged in as:" not in response.content:
|
||||
raise exception.AuthenticationError()
|
||||
return {c: response.cookies[c] for c in self.cookies_names}
|
||||
|
||||
# collect more cookies
|
||||
url = self.root + "/favorites.php"
|
||||
response = self.request(url)
|
||||
if response.history:
|
||||
self.request(url)
|
||||
|
||||
return self.cookies
|
||||
|
||||
|
||||
class ExhentaiGalleryExtractor(ExhentaiExtractor):
|
||||
|
Loading…
Reference in New Issue
Block a user