[exhentai] revert login-method to its old version (#37)

Additional cookies don't seem to help and have to be manually set
anyway. The older method is more likely to succeed, so I'd rather
use this one.
pull/40/head
Mike Fährmann 7 years ago
parent 3ee39ffd93
commit c0755a4d5e
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -196,11 +196,6 @@ class ExhentaiGalleryExtractor(Extractor):
def _login_impl(self, username, password): def _login_impl(self, username, password):
"""Actual login implementation""" """Actual login implementation"""
self.log.info("Logging in as %s", username) self.log.info("Logging in as %s", username)
# visit "home.php" to get "__cfduid" cookie
response = self.request("https://e-hentai.org/home.php")
# send login form
url = "https://forums.e-hentai.org/index.php?act=Login&CODE=01" url = "https://forums.e-hentai.org/index.php?act=Login&CODE=01"
data = { data = {
"CookieDate": "1", "CookieDate": "1",
@ -211,25 +206,13 @@ class ExhentaiGalleryExtractor(Extractor):
"ipb_login_submit": "Login!", "ipb_login_submit": "Login!",
} }
headers = { headers = {
"Referer": response.url "Referer": "https://e-hentai.org/bounce_login.php?b=d&bt=1-1"
} }
response = self.request(url, method="POST", data=data, headers=headers) response = self.request(url, method="POST", data=data, headers=headers)
# visit "exhentai.org" to transfer cookies if "You are now logged in as:" not in response.text:
self.wait(1.5)
response = self.request("https://exhentai.org")
if self._is_sadpanda(response):
raise exception.AuthenticationError() raise exception.AuthenticationError()
return {c: response.cookies[c] for c in self.cookienames}
# collect exhentai cookies in dict (this should yield
# "ipb_member_id", "ipb_pass_hash", "igneous", and "yay")
cookies = {
c.name: c.value
for c in self.session.cookies
if c.domain == self.cookiedomain
}
return cookies
@staticmethod @staticmethod
def _is_sadpanda(response): def _is_sadpanda(response):

@ -63,7 +63,7 @@ skip = [
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie", "exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
"archivedmoe", "archiveofsins", "thebarchive", "archivedmoe", "archiveofsins", "thebarchive",
# temporary issues # temporary issues
"jaiminisbox", # 522 "imgtrex", # 504
"e621", "e621",
"3dbooru", "3dbooru",
] ]

Loading…
Cancel
Save