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