1
0
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:
Mike Fährmann 2023-12-04 22:49:28 +01:00
parent ad0134daf7
commit da0da0faaa
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -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):