subdavis / kobo-book-downloader

A tool to download and remove DRM from your purchased Kobo.com ebooks and audiobooks.
https://pypi.org/project/kobodl/
The Unlicense
348 stars 33 forks source link

403 Client error when trying to add user #121

Open Yummiii opened 1 month ago

Yummiii commented 1 month ago

Before you open an issue Please make sure you've upgraded to the latest version of kobodl on pypi or docker. Also read through the troubleshooting guide. Try running with --debug enabled and see what comes up in the debug log.

Do not erase this template, it's here to help you.

Describe the issue When trying to add a new user with ./kobodl-ubuntu user add or with the webui on docker, it fails with requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=8.11.24971&pwspid=00000000-0000-0000-0000-000000004000&pwsdid=2852a229-f8c0-4006-8836-ca8590a96de6

To Reproduce Steps to reproduce the behavior:

  1. Execute the command to add a new user
  2. Input the credentials
  3. Copy captcha from the site
  4. See error

Expected behavior A new user being added

Screenshots Screenshot from 2024-09-27 19-11-27

Desktop (please complete the following information):

BakaUshi commented 1 month ago

getting the same error for the past 2 weeks also - tried various methods (.exe, running via python command line, using the web server) and issue occurs with all of them. I recall seeing some news about changes coming to the Kobo desktop app, so possibly some back-end athentication changes were made. I can't find specific details about it, but this recent blog post mentions some updates to the apps: https://www.kobo.com/blog/kobos-summer-2024-update-on-new-features-and-fixes

geekylou commented 1 month ago

I wonder if this is related to https://github.com/subdavis/kobo-book-downloader/issues/118#issuecomment-2325946137 which I think is caused by cloudflare blocking urllib.

jajpater commented 1 month ago

Same problem here.

BakaUshi commented 1 month ago

didn't work still get 403 with this code:

# response = self.Session.post(signInUrl, data=postData)
scraper = cloudscraper.create_scraper() 
response= scraper.post(signInUrl, data=postData)
subdavis commented 4 weeks ago

I cannot reproduce this bug.

LordAsaki commented 3 weeks ago

Same problem here with the Windows build.

AudioAnchorite commented 3 weeks ago

Is it possibly related to the browser? Is it intended to be used on Chrome, when we are using FireFox, LibreWolf, or Brave?

LordAsaki commented 3 weeks ago

Is it possibly related to the browser? Is it intended to be used on Chrome, when we are using FireFox, LibreWolf, or Brave?

I tried Firefox, Edge, and Chrome; they all worked the same.

subdavis commented 3 weeks ago

No, this is not related to browser, nor will the behavior differ between builds (pip, windows, docker). If you're getting a 403, your account is somehow being treated differently by kobo servers than mine is. Do you all have proper kobo accounts?

You must have a kobo email login. See "I can't log in" in the troubleshooting section for how to workaround this requirement.

LordAsaki commented 3 weeks ago

Mine is an email login.

subdavis commented 3 weeks ago

I made a brand new account. I got a 403 the first time I tried to log in with the new account. I tried a second time with debug enabled and it succeeded. I tried a third time with debug disabled and it succeeded.

I don't really know why this would be.

LordAsaki commented 3 weeks ago

No luck here yet. Tried a new account, tried with and without --debug, tried with and without --captcha, tried with and without admin privileges... Hopefully it can be figured out, I just bought an audiobook today and wanted to throw it on my MP3 player =)

AudioAnchorite commented 3 weeks ago

No, this is not related to browser, nor will the behavior differ between builds (pip, windows, docker). If you're getting a 403, your account is somehow being treated differently by kobo servers than mine is. Do you all have proper kobo accounts?

You must have a kobo email login. See "I can't log in" in the troubleshooting section for how to workaround this requirement.

Yep, switched to email login when I found this package some time ago. Downloaded many an EPUB before this issue. I installed 24H2 a few days ago as well, which is how I discovered the problem.

alex1299 commented 3 weeks ago

Same here. It has been working for about a year, and even now, running "kobodl-windows.exe book list " still shows me a list of my books. However, I can't retrieve any audiobooks—only ePub files seem to work. So, I started from scratch with the latest version, using: "kobodl-windows.exe user add" but I encountered the same issue: requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=8.11.2 4971&.....

matteo-l commented 3 weeks ago

I get the 403 error if I try to add a user with the docker image (kobodl 0.9.3) on debian 12 and a 500 error with the pip install (kobodl 0.9.3 and 0.9.4) on ubuntu 20.04. If I start the latter with the debug option I get the following text in debug.log

2024-11-02 14:28:32.756812
['/home/matteo/.local/bin/kobodl', '--debug', 'user', 'add']
2024-11-02 14:29:36.821706
AuthenticateDevice
{"ResponseStatus":{"ErrorCode":"BadRequestException","Message":"Device authentication requests should not contain an Authentication header."}}

On ubuntu kobodl 0.9.3 worked fine a few weeks ago.

I'm in Italy, I don't know if it matters.

heluq commented 2 weeks ago

I am in spain, same issues File "kobodl__main.py", line 5, in File "click\core.py", line 829, in call__ File "click\core.py", line 782, in main File "click\core.py", line 1259, in invoke File "click\core.py", line 1259, in invoke File "click\core.py", line 1066, in invoke File "click\core.py", line 610, in invoke File "click\decorators.py", line 33, in new_func File "kobodl\commands\user.py", line 80, in add File "kobodl\actions.py", line 169, in Login File "kobodl\kobo.py", line 455, in Login File "kobodl\kobo.py", line 145, in GetExtraLoginParameters File "requests\models.py", line 1024, in raise_for_status requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://authorize.kobo.com/signin?returnUrl=http://kobo.com/&wsa=Kobo&pwsav=xxxxx [PYI-4556:ERROR] Failed to execute script 'main__' due to unhandled exception!

WinterBaas commented 2 weeks ago

I get the same error. Tried it with two different accounts. Any solution?

lubomir-brindza commented 1 week ago

Hitting this as well; I've dumped the contents of the 403 response body to https://ext.halka.sk/challenge.html - looks like some extra JS-based validation/redirection; excerpt here:

<title>Challenged | Kobo.com</title>
...
<div class="section"><center><div>
    <p id="cf-spinner-please-wait"></p>
    <p id="cf-spinner-redirecting" style="display:none"></p>
</div>
<noscript><h1>Please turn JavaScript on and reload the page.</h1></noscript>
<div id="no-cookie-warning" style="display:none"><p>Please enable Cookies and reload the page.</p></div>
<form id="challenge-form"></form>
<script>(function(){window._cf_chl_opt={cvId: '3',cZone: "authorize.kobo.com",cType: 'managed',cRay: '8e1e1b95fe776e91',cH: ...