|
|
@@ -56,9 +56,14 @@ class Kobo:
|
|
|
DisplayProfile = "Android"
|
|
|
|
|
|
def __init__( self ):
|
|
|
+ # Use the user agent of the Kobo Android app, otherwise the login request hangs forever.
|
|
|
+ headers = {
|
|
|
+ "User-Agent": "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",
|
|
|
+ }
|
|
|
+
|
|
|
self.InitializationSettings = {}
|
|
|
self.Session = SessionWithTimeOut()
|
|
|
- self.Session.headers.update( { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:99.0) Gecko/20100101 Firefox/99.0" } )
|
|
|
+ self.Session.headers.update( headers )
|
|
|
|
|
|
# This could be added to the session but then we would need to add { "Authorization": None } headers to all other
|
|
|
# functions that doesn't need authorization.
|
|
|
@@ -182,7 +187,8 @@ class Kobo:
|
|
|
"__RequestVerificationToken": requestVerificationToken,
|
|
|
"LogInModel.UserName": email,
|
|
|
"LogInModel.Password": password,
|
|
|
- "g-recaptcha-response": captcha
|
|
|
+ "g-recaptcha-response": captcha,
|
|
|
+ "h-captcha-response": captcha
|
|
|
}
|
|
|
|
|
|
response = self.Session.post( signInUrl, data = postData )
|