Skip to content

Commit f1f1371

Browse files
authored
Implement TnS-hun's fix for API calls (#78)
1 parent c7d17b1 commit f1f1371

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kobodl/kobo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,14 @@ class Kobo:
5050
ApplicationVersion = "8.11.24971"
5151
DefaultPlatformId = "00000000-0000-0000-0000-000000004000"
5252
DisplayProfile = "Android"
53+
UserAgent = "Mozilla/5.0 (Linux; Android 6.0; Google Nexus 7 2013 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/74.0.3729.186 Safari/537.36 KoboApp/8.40.2.29861 KoboPlatform Id/00000000-0000-0000-0000-000000004000 KoboAffiliate/Kobo KoboBuildFlavor/global"
5354

5455
def __init__(self, user: User):
5556
self.InitializationSettings = {}
5657
self.Session = requests.session()
58+
self.Session.headers.update({
59+
"User-Agent": Kobo.UserAgent
60+
})
5761
self.user = user
5862

5963
# PRIVATE METHODS
@@ -462,6 +466,7 @@ def Login(self, email: str, password: str, captcha: str) -> None:
462466
"LogInModel.UserName": email,
463467
"LogInModel.Password": password,
464468
"g-recaptcha-response": captcha,
469+
"h-captcha-response": captcha,
465470
}
466471

467472
response = self.Session.post(signInUrl, data=postData)

0 commit comments

Comments
 (0)