-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 403 authorization errors #128
base: main
Are you sure you want to change the base?
Conversation
kobodl/kobo.py
Outdated
def get_cookie_value(cookie_name): | ||
if cookie_name in cookie: | ||
return cookie[cookie_name].value | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This closure is never called; did you mean to leave this in here?
e: Looking at this some more, there's some redundant code here; this whole block (529-543) seems like it's a leftover and no longer necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! That definitely shouldn't be in here. I'll delete it
I can confirm that this PR does fix the login issue for me, nice work :) @subdavis apologies for barging in here, I just know from the related issues that you're not affected / able to reproduce this |
@@ -166,7 +184,7 @@ def __GetExtraLoginParameters(self) -> Tuple[str, str, str]: | |||
) | |||
requestVerificationToken = html.unescape(match.group(1)) | |||
|
|||
return koboSignInUrl, workflowId, requestVerificationToken | |||
return koboSignInUrl, workflowId, requestVerificationToken, authCookie |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update the return type for __GetExtraLoginParameters
to Tuple[str, str, str, str]
…_GetExtraLoginParameters function
Please merge this soon. I reseted my account and now I can't add a user or download. Thanks for your work. |
This doesn't seem to fix it for me, but I'm seeing it on the download request.
|
Thanks everyone for your involvement in this fix. I'll get this merged and released later this evening. |
Probably related: #127
For some reason the authentication process returns 403 errors all of a sudden. I think this is due to CloudFlare blocking the requests automatically. This branch solves it by using
urllib
instead ofrequests
in the specific faulty requests, as pointed out in a StackOverflow post](https://stackoverflow.com/a/74674276).