-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Can't download HTTP Error 403: Forbidden #27
Comments
Yep, I received the same error just now. It was working fine until yesterday, so this must be from the Libby side. They must have blocked it. Currently I'll have to move to manual downloading from the libby site and load it in Calibre. I will let you know if I find a workaround. |
I'm having trouble downloading magazines (just in the past day or two): calibre, version 6.14.1 calibre 6.14.1 Portable embedded-python: True |
Also started receiving this error when opening the plugin on both 7.8 and 7.9. |
I hope @ping would come along and update. Pretty please... |
Someone found a solution (temporarily).
The line should look something like The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json And if you're using Chrome for the first steps, instead of Persist Logs, it's called Preserve Logs. So tick that and then the GET request should have an icon that looks like this: {;} and the name showed up for me as counts?cards= string of numbers and symbols |
Many (including me) have posted on MobileRead that this isn't working for them, unfortunately. |
It didn't work for magazines. |
I only need it for magazines. For books, I download directly from the library website, then import, since when I downloaded them directly all I got was an .acsm file, not the actual book anyway. Unfortunately, there's no way (that I know of) to get the magazines directly from the library site. I was often getting additional errors when I marked & copied just the relevant part, so if I retry, I'll try it as you suggest, which (if I understand correctly) is copy everything from "Bearer" to the end of the token, paste it into the json file, and then delete "Bearer"? Edit: I tried it this way, but not only do magazine-downloads still not work, but I get errors when I load the plugin. All I can do is revert back to the previous .json file. I am using notepad to open and paste the token into the file. Is there something else I should be using? But unless there's a way to restore magazine downloads, it doesn't seem to be worth the effort, since everything but downloading works with the un-edited .json file. |
Yes, when you download books through the plugin it will give you .acsm file which will be automatically converted to .epub if you have the DeACSM plugin installed. That's how I set it up on my pc. It worked flawlessly till this 403 error. |
Can confirm this works for downloading books now!! Awesome! |
I do have that plugin, but it hasn't automatically converted for me, hence my always downloading more directly. Also, I've tried multiple times to enter the token from the website, and it always gives me errors when starting up the plugin, so I end up restoring the .json from a backed-up copy. Do I need to use a certain editor to make it work? I've been using Notepad. Though in the end, if it doesn't let me download magazines, I'm not sure it's worth the effort, since everything else works the way I'm used to using it. |
I get if you wonder its worth the effort. For me, my main mode getting books is through libby as their books are neatly formatted. So this work flow suits me. It might vary for you though. |
Are you suggesting I should use the one with only one number and not the "cards=..." ? However, flipping between them (and a few similar ones), the token looks exactly the same. I didn't literally compare them byte for byte, but I would expect a quick flip to show a change if there was any difference, and I don't see anything changing. I've been using notepad, not notepad++; I just tried in Notepad++ and got the same kind of error trying to open the plugin as I got when using notepad, so it doesn't seem to make any difference, referencing a unicode character it didn't like. UnicodeEncodeError: 'latin-1' codec can't encode character '\u2026' in position 512: ordinal not in range(256) The \u2026 character is an elipsis, I found a MobileRead post suggesting copying with right-click rather than the more typical way, since the ellipsis might not be an actual character in the token, but instead indicating there were additional characters not shown. Using that actually allowed me to open the plugin without trouble, and I found I could even download a book as an epub, which had never worked before. But still no working magazine downloads, which is the main functionality I'm missing (and one I had been using a lot). |
Yes, I have used right-click to copy the authentication code. They change the code occasionally, as I have already done it twice with a different code each time. This temporary fix is fine for books. But for magazines, sadly there seems to be no solution yet. |
I keep getting this error as well, practically every time I am trying to use the plugin. While it is nice to have the workaround, it would be even nicer if the fix got implemented into the plugin itself. Any info from @ping on this? |
If someone can take one for the team and make a donation (he listed his donation page) and leaving a nice message to him to please consider come online and update the plugin, I think it'd be great. I was going to do it but it requires credit card, if only it accepts Paypal. |
Can I ask how often you use the plugin? I'm asking because I think this error doesn't happen if you use the plugin regularly. I know I have not got this error for ages (feels like months) and that the token that you copy from the website expires after some time (I think it only lasts about a week). Also, when you open the plugin the token is refreshed. Hence my theory is that if you open the plugin every few days, then you never need to use the workaround. I agree it would be nice if the fix got implemented into the plugin, but I don't think we can expect ping to help. He/She previously said that he/she didn't have the time and was looking for someone else to take over maintenance of the plugins and hasn't been active on github or the calibre forums. |
I use the plugin daily. I should say, however, that things are working fine for me with ebooks since I manually copied the code (once I found the magic method to copy it properly, since the more intuitive method didn't work), just not with magazines. Although it's convenient to use the plugin for ebooks, it's also possible to download them directly from the libraries and then import. Magazines, though, were downloadable only via the plugin, so that's why to me getting that fixed has higher priority. I didn't see an announcement from Ping that they didn't have the time, but since they haven't replied to these issues, it does seem likely that they aren't maintaining it anymore. Is there anyone around who has the knowledge/experience to fix? I wish I did, but I don't. |
I'm not sure if there was an announcement, but I think there may have been several mentions and one of them was at #12 (comment) |
I didn't see that post, so thanks for pointing it out. I do wish someone can take this on. |
I wrote a chrome extension that extracts the token, because the 403 error tends to repeat itself after days or weeks, even after applying this fix. |
interesting, chrome wont allow it to be activated, well at least mine wont. Maybe orhers can try it. |
Try downloading the extension as a ZIP file, unpacking the zip to a folder, going to |
That doesn't work either. when i try i get a missing manifest file or unreadable....i can drag the crx file to the extension tab but after its added i can't enable.. |
I got this work in Edge. This was done earlier before TheBoyLeastLikelyTo suggestion, but it was something similar. In my case, I clicked on releases and download the source code (zip). The reason I mention the last bit is that the default for windows is to extract the files into a new folder based on the name of the file you have downloaded (In my case LibbyApp-Token-Final). But the files inside the zip file and already in a folder (in my case called LibbyApp-Token-Final), so you have to browse to the inner folder LibbyApp-Token-Final/LibbyApp-Token-Final. |
I never thought to test for Edge. I am a ex-Chrome (now Firefox) user. Does it work the same in Edge as chrome due to shared chromium platform? |
Correct. I would not expect it to work on the old Edge (pre 2020) as that wasn't based on chromium
Interesting. If you only started this extension yesterday, why choose to do it in Chrome rather than FireFox ? |
Unlikely. The fact that the book now shows would suggest the plugin is working fine. If I had to guess, I would say this book is only available in one format which is the format used by the Libby app and the website. If I am correct, then the available formats may depend on your library. I'm guessing, but this information does not show up on the share link for example https://share.libbyapp.com/title/6835533 but does show up if you pick a random library e.g. https://libbyapp.com/library/cityoflondonuk/curated-1191972/page-1/6835533. So if might be an idea to see if other libraries treat this book the same. |
As per Sept 25 books download got Error 403: Forbidden again and the workaround above doesn't work :( Maybe it's end of the road for now? sigh |
Yup. That looks like it. For now its gonna be download directly from Libby site and load it into Calibre. But searching and borrowing works fine in the plugin though. |
I would have thought anything that can be done manually by going to a web site can be automated. It's all just network traffic. |
Easy to say. Why don't you try to provide a workaround then? |
For basically the same reason the fact that I think one can run 100m in under 10 seconds doesn't mean I can do it. |
By the looks of it, the overdrive frontend is the only way to get books now, back end token API no longer working. I'm going to make a headless version of the website just using http requests. |
Very good. I would be interested to know how you get on. Is this going to be written in python? On another topic, may I ask why you archived https://github.com/simon-techkid/LibbyApp-Token ? |
Python is the way to go for calibre integration, but that will take a backseat until http requests are working.
Token requests using OverDrive website aren't working for Libby Calibre plugin any longer, AFAIK. |
I'm still able to sync, borrow, hold, return and search in the plugin with a token from your extension. |
That's great to hear, @sgmoore. I'll reopen the repo, and introduce support for automatically inserting the new token into the |
Wait, really @sgmoore? I and one other people tried updating our token but it won't work! |
They have a functional fork. |
@sgmoore I forgot that I found a CLI that kinda works here: https://github.com/notmarek/libbydl. So far de-DRM-ing has failed and author didn't respond but borrowing works. I dunno whether downloads work or not but it seems it is because the failed message is only about de-DRM-ing that doesn't work. Maybe this can be of help? |
Are you saying that the exact same token allows you to see your loans with this repo, but not the calibre plugin? Don't think this will help with downloading books. The code is not checking the response when trying to download a book and merely passing the content to the drm routine which will obviously fail if the actual content is missing. Don't think it is worthwhile forking but if you want to check this you can edit the python file and add the following line before line 49 .
This returns an 403 and just one byte showing that the book is not actually being downloaded. |
Never need any token. Just set it up using the code (generated from Sonos mode) and it's good to go. Right now I can access holds and loans. Borrow also works. But download doesn't. It only said "Hey that doesn't work!" so I don't know which part doesn't work exactly. |
New version of LibbyApp-Token Browser extension is now available, Version 1.3 implements WebExtensions API so the extension should work with Firefox. In the next release, I'm going to broaden the focus of this extension to allow access to any website's auth token upon running the popup. |
Oh wow, thanks, and right after I figured out how to transfer my Libby to Chrome 😆 |
@sgmoore I have a quick fix on top of your 0.1.9.1 release that removes the need to manually re-fetch the libby_token values (#31). Happy to release it as 0.1.9.2 from my fork or PR your fork if you're the new de facto plugin maintainer and you think it would be useful. In terms of fixing the download functionality mentioned in this issue and #35, libby added some targeted security measures and code obfuscation to the download action making it potentially unwise to publish a reverse engineered workaround. |
Thanks. My token is due to expire in about six hours so I'll see how it handles it.
Would you be interested in becoming the de facto plugin maintainer? Looking at your github repos, you obviously are a much, much better python programmer than I am (which isn't really saying much).
Interesting. Are you saying you have a workaround but don't want to publish it? |
Great, let me know how it goes. For me, the change made it so that the plugin continues to work even with an expired token. Looking at it now, it seems the expired token stays in the preferences file, and the plugin doesn't write back the updated token like I would have expected. That could be fixed, but it doesn't seem to be an issue for now.
That's more than generous. I am happy to try to keep the boat afloat, but don't really have capacity for ongoing quality-of-life maintenance.
Yes, I'm concerned about publishing code that could be considered to bypass a technical protection measure. It seems like Libby deliberately introduced this measure to brake all third party integrations, including this plugin, odmpy, libby-download-extension, etc. I just reached out to the EFF for feedback. |
Worked perfectly. So thank you very much.
I noticed that. It just means one extra request.
So is that a yes, or a 'no thanks' ?
Understood. |
Great, thanks!
I'd rather not, but if there's no one else, I'm okay to stand in until @ping re-engages or someone else steps up. |
It's great to see there's some people that are still using this. I just hope someone can do something for the few of us that this methods don't work....I keep getting the message the Libby isn't setup and I can't do anything until I get passed that. |
@TheBookishDad It sounds like you're having a different issue than this one. Perhaps take a look at #30? |
I cant get that to work i try the generate code for speaker option and get clientconnectionerror in calibre. Thank you for trying though |
@TheBookishDad Take a look at the discussion under issue #33. Have you already gone through those fixes and installed @sgmoore's updated plugin? If so, and you're still having an issue, I'd suggest creating a new GitHub issue since it's not related to this one. |
OK. |
`calibre, version 7.8.0
ERROR: Unhandled exception: ClientForbiddenError: Failed to download e-book
HTTP Error 403: Forbidden
calibre 7.8 embedded-python: True
macOS-14.4.1-arm64-arm-64bit Darwin ('64bit', '')
('Darwin', '23.4.0', 'Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030')
Python 3.11.5
OSX: ('14.4.1', ('', '', ''), 'arm64')
Interface language: None
EXE path: /Applications/calibre.app/Contents/MacOS/calibre
Successfully initialized third party plugins: DeACSM (0, 0, 16) && DeDRM (10, 0, 3) && BookFusion Plugin (0, 8, 1) && Count Pages (1, 13, 6) && Goodreads (1, 8, 1) && Goodreads Sync (1, 16, 5) && Import List (1, 9, 4) && Job Spy (1, 0, 239) && Modify ePub (1, 8, 3) && OverDrive Libby (0, 1, 9)
Traceback (most recent call last):
File "calibre_plugins.overdrive_libby.libby.client", line 520, in send_request
response = req_opener.open(req, timeout=self.timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "urllib/request.py", line 525, in open
File "urllib/request.py", line 634, in http_response
File "urllib/request.py", line 563, in error
File "urllib/request.py", line 496, in _call_chain
File "urllib/request.py", line 643, in http_error_default
urllib.error.HTTPError: HTTP Error 403: Forbidden
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "calibre/gui2/threaded_jobs.py", line 85, in start_work
File "calibre_plugins.overdrive_libby.ebook_download", line 50, in call
downloaded_filepath = self._custom_download(
^^^^^^^^^^^^^^^^^^^^^^
File "calibre_plugins.overdrive_libby.ebook_download", line 94, in _custom_download
res_content = libby_client.fulfill_loan_file(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "calibre_plugins.overdrive_libby.libby.client", line 808, in fulfill_loan_file
res: bytes = self.send_request(
^^^^^^^^^^^^^^^^^^
File "calibre_plugins.overdrive_libby.libby.client", line 540, in send_request
ErrorHandler.process(e, error_response)
File "calibre_plugins.overdrive_libby.libby.errors", line 143, in process
raise error_info["error"](
calibre_plugins.overdrive_libby.libby.errors.ClientForbiddenError: <calibre_plugins.overdrive_libby.libby.errors.ClientForbiddenError; http_status=403, msg='HTTP Error 403: Forbidden', error_response=' ''>
`
Have tried re-installing, regenerating Libby login, clearing cache. Using Calibre 7.8. Anyone else having problems? Have any suggestions for troubleshooting?
The text was updated successfully, but these errors were encountered: