Skip to content

Commit

Permalink
Changed login method
Browse files Browse the repository at this point in the history
- Due to the addition of a captcha for logging in, the previous method stopped working. Now we have to specify the token manually, by analogy with wuxiaworld.
  • Loading branch information
CryZFix committed Oct 30, 2023
1 parent a80006c commit a643d5b
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions sources/en/m/mtlnation.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,9 @@ def initialize(self):
self.init_executor(1)

def login(self, email: str, password: str) -> None:
self.post_json(
"https://api.mtlnation.com/api/v2/accounts/login",
data=json.dumps(
{
"identity": email,
"password": password,
}
),
)
jwt = self.cookies.get("jwt")
self.set_header("authorization", f"JWT {jwt}")
logger.info("Logged in with jwt %s", jwt)
self.set_header("Authorization", f"{email} {password}")
response = self.get_json("https://api.mtlnation.com/api/v2/users/me")
logger.info("Logged in as %s" % response["data"]["name"])

def search_novel(self, query):
data = self.get_json(
Expand Down

0 comments on commit a643d5b

Please sign in to comment.