Skip to content
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

Open
jessRun opened this issue Apr 25, 2024 · 59 comments
Open

Can't download HTTP Error 403: Forbidden #27

jessRun opened this issue Apr 25, 2024 · 59 comments

Comments

@jessRun
Copy link

jessRun commented Apr 25, 2024

`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?

@SeriousHornet
Copy link

SeriousHornet commented Apr 26, 2024

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.

@LoisGNS
Copy link

LoisGNS commented Apr 26, 2024

I'm having trouble downloading magazines (just in the past day or two):

calibre, version 6.14.1
ERROR: Unhandled exception: KeyError: Failed to download e-book

calibre 6.14.1 Portable embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.10.1
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeACSM (0, 0, 16) && Gather KFX-ZIP (from KFX Input) (2, 10, 0) && DeDRM (10, 0, 3) && Package KFX (from KFX Input) (2, 10, 0) && Access Aide (0, 1, 13) && Action Chains (1, 18, 19) && Annotations (1, 17, 13) && Calibre Power Search Plugin (2, 2, 0) && CalibreSpy (1, 0, 92) && Count Pages (1, 13, 6) && DOC Input (1, 0, 1) && Ebook Translator (2, 3, 3) && Editor Chains (0, 8, 3) && EpubMerge (2, 18, 0) && EpubSplit (3, 6, 0) && FanFicFare (4, 20, 0) && FictionDB (1, 4, 1) && Find Duplicates (1, 10, 9) && GetFileName (0, 2, 0) && Goodreads (1, 8, 1) && Goodreads_Rating (4, 0, 0) && Job Spy (1, 0, 205) && KFX metadata reader (from KFX Input) (2, 10, 0) && From KFX (2, 10, 0) && KFX Input (2, 10, 0) && Set KFX metadata (from KFX Output) (2, 3, 1) && KFX Output (2, 3, 1) && Kindle Collections (1, 7, 29) && KindleUnpack - The Plugin (0, 83, 1) && Mass Search-Replace (1, 7, 1) && Media File Importer (1, 0, 27) && Modify ePub (1, 8, 2) && MultiColumnSearch (1, 0, 96) && Open With (1, 8, 1) && OverDrive Libby (0, 1, 9) && Overdrive Link (2, 57, 0) && Reading List (1, 15, 1) && Save To Format (0, 0, 6) && Search The Internet (1, 10, 4) && Similar Stories (1, 0, 58) && Standard Ebooks (1, 0, 0) && TTS to MP3 (0, 6, 0) && View Manager (1, 10, 2) && Wiki Reader (2, 2, 1) && all recipes Recipe Reader (1, 0, 2) && Overdrive Link Metadata Source (2, 57, 0)
Traceback (most recent call last):
File "calibre\gui2\threaded_jobs.py", line 82, in start_work
File "calibre_plugins.overdrive_libby.magazine_download", line 387, in call
File "calibre_plugins.overdrive_libby.magazine_download", line 467, in _custom_download
File "calibre_plugins.overdrive_libby.libby.client", line 822, in process_ebook
KeyError: 'openbook'

@sarcheer
Copy link

sarcheer commented Apr 26, 2024

Also started receiving this error when opening the plugin on both 7.8 and 7.9.

@p1nkyy
Copy link

p1nkyy commented Apr 26, 2024

I hope @ping would come along and update. Pretty please...

@p1nkyy
Copy link

p1nkyy commented May 2, 2024

Someone found a solution (temporarily).

1. In your browser, open your dev console (ctrl-shift-I or F12 for me).
2. Go to the network tab, click the cog at the top-right and make sure "Persist Logs" is on.
3. Go to https://libbyapp.com/.
4. In the dev console, type "sentry" into the filter bar.
5. Click on the furthest-down entry that is a "GET" request.
6. In the right panel, go into the "Request Headers" and find "Authorization" -- its format should be "Bearer" followed by a long string of characters. Copy just the long string.
7. Make sure Calibre is closed, and open the plugin config file (%APPDATA%\calibre\plugins\overdrive_libby.json on Windows, unsure Mac/Linux paths).
8. Find the line for "libby_token", and replace its value with the one you copied in step 6.
9. Open Calibre and the plugin should work as expected now.

The line should look something like "libby_token": "eyJ0eX", (except the token will be hundreds of characters long. )

The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json
To get to it you could also open Calibre, go to Preferences, Miscellaneous, Open Calibre Configuration Folder, then close the app when the folder opens.

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

@LoisGNS
Copy link

LoisGNS commented May 2, 2024

Many (including me) have posted on MobileRead that this isn't working for them, unfortunately.

@p1nkyy
Copy link

p1nkyy commented May 2, 2024

Many (including me) have posted on MobileRead that this isn't working for them, unfortunately.

It didn't work for magazines.
If it doesn't work for you for books then you must be copying the string incorrectly or something. Try copying the whole thing instead of blocking it manually and remove Bearer in front of the string. It finally worked for me.

@LoisGNS
Copy link

LoisGNS commented May 2, 2024

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.

@SeriousHornet
Copy link

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.

@SeriousHornet
Copy link

Someone found a solution (temporarily).

1. In your browser, open your dev console (ctrl-shift-I or F12 for me).
2. Go to the network tab, click the cog at the top-right and make sure "Persist Logs" is on.
3. Go to https://libbyapp.com/.
4. In the dev console, type "sentry" into the filter bar.
5. Click on the furthest-down entry that is a "GET" request.
6. In the right panel, go into the "Request Headers" and find "Authorization" -- its format should be "Bearer" followed by a long string of characters. Copy just the long string.
7. Make sure Calibre is closed, and open the plugin config file (%APPDATA%\calibre\plugins\overdrive_libby.json on Windows, unsure Mac/Linux paths).
8. Find the line for "libby_token", and replace its value with the one you copied in step 6.
9. Open Calibre and the plugin should work as expected now.

The line should look something like "libby_token": "eyJ0eX", (except the token will be hundreds of characters long. )

The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json To get to it you could also open Calibre, go to Preferences, Miscellaneous, Open Calibre Configuration Folder, then close the app when the folder opens.

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

Can confirm this works for downloading books now!! Awesome!

@LoisGNS
Copy link

LoisGNS commented May 4, 2024

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.

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.

@SeriousHornet
Copy link

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.

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.

  1. Did you input the Adobe Digital Editions key in the DeACSM plug-in?
  2. Where did you copy the token from? For me, it was not the last entry, but two before that. I would suggest removing the Libby plugin completely, reinstalling it and editing the .json file. I used Notepad++ for editing.

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.

@LoisGNS
Copy link

LoisGNS commented May 6, 2024

1. Did you input the Adobe Digital Editions key in the DeACSM plug-in?

2. Where did you copy the token from? For me, it was not the last entry, but two before that. I would suggest removing the Libby plugin completely, reinstalling it and editing the .json file. I used Notepad++ for editing.
  1. The plugin says "Authorized with ADE ID (AdobeID) xxxxxxxx on device xxxxx, emulating ADE 2.01 (9.3.58046). I routinely download from the library & it opens in Adobe Digital Editions. Drag/drop that into Calibre.
  2. The instructions said to use the last listing with "sentry" in it, and click GET. Under File, it says "counts?cards=xxxxxxxx,xxxxxxxx". Two lines above that, under "file" there is a sequence of 7 numbers, as opposed to 8 numbers-comma-8 numbers.

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).

@SeriousHornet
Copy link

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.

@mr-berndt
Copy link

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?

@p1nkyy
Copy link

p1nkyy commented Jul 1, 2024

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.

@LoisGNS
Copy link

LoisGNS commented Jul 1, 2024

I'd consider it if I saw any sign that @ping is paying attention. @ping, if you're around and willing to take a look at this, there might be some donations coming your way. The magazine download capability is the thing I miss most, since the plugin is the only way I'm aware of to do that.

@sgmoore
Copy link

sgmoore commented Jul 1, 2024

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

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.

@LoisGNS
Copy link

LoisGNS commented Jul 1, 2024

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.

@sgmoore
Copy link

sgmoore commented Jul 1, 2024

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.

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)

@LoisGNS
Copy link

LoisGNS commented Jul 2, 2024

I didn't see that post, so thanks for pointing it out. I do wish someone can take this on.

@simon-techkid
Copy link

Someone found a solution (temporarily).

1. In your browser, open your dev console (ctrl-shift-I or F12 for me).
2. Go to the network tab, click the cog at the top-right and make sure "Persist Logs" is on.
3. Go to https://libbyapp.com/.
4. In the dev console, type "sentry" into the filter bar.
5. Click on the furthest-down entry that is a "GET" request.
6. In the right panel, go into the "Request Headers" and find "Authorization" -- its format should be "Bearer" followed by a long string of characters. Copy just the long string.
7. Make sure Calibre is closed, and open the plugin config file (%APPDATA%\calibre\plugins\overdrive_libby.json on Windows, unsure Mac/Linux paths).
8. Find the line for "libby_token", and replace its value with the one you copied in step 6.
9. Open Calibre and the plugin should work as expected now.

The line should look something like "libby_token": "eyJ0eX", (except the token will be hundreds of characters long. )

The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json To get to it you could also open Calibre, go to Preferences, Miscellaneous, Open Calibre Configuration Folder, then close the app when the folder opens.

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

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.

@TheBookishDad
Copy link

Someone found a solution (temporarily).

1. In your browser, open your dev console (ctrl-shift-I or F12 for me).
2. Go to the network tab, click the cog at the top-right and make sure "Persist Logs" is on.
3. Go to https://libbyapp.com/.
4. In the dev console, type "sentry" into the filter bar.
5. Click on the furthest-down entry that is a "GET" request.
6. In the right panel, go into the "Request Headers" and find "Authorization" -- its format should be "Bearer" followed by a long string of characters. Copy just the long string.
7. Make sure Calibre is closed, and open the plugin config file (%APPDATA%\calibre\plugins\overdrive_libby.json on Windows, unsure Mac/Linux paths).
8. Find the line for "libby_token", and replace its value with the one you copied in step 6.
9. Open Calibre and the plugin should work as expected now.

The line should look something like "libby_token": "eyJ0eX", (except the token will be hundreds of characters long. )
The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json To get to it you could also open Calibre, go to Preferences, Miscellaneous, Open Calibre Configuration Folder, then close the app when the folder opens.
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

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.

@simon-techkid
Copy link

simon-techkid commented Aug 23, 2024

Someone found a solution (temporarily).

1. In your browser, open your dev console (ctrl-shift-I or F12 for me).
2. Go to the network tab, click the cog at the top-right and make sure "Persist Logs" is on.
3. Go to https://libbyapp.com/.
4. In the dev console, type "sentry" into the filter bar.
5. Click on the furthest-down entry that is a "GET" request.
6. In the right panel, go into the "Request Headers" and find "Authorization" -- its format should be "Bearer" followed by a long string of characters. Copy just the long string.
7. Make sure Calibre is closed, and open the plugin config file (%APPDATA%\calibre\plugins\overdrive_libby.json on Windows, unsure Mac/Linux paths).
8. Find the line for "libby_token", and replace its value with the one you copied in step 6.
9. Open Calibre and the plugin should work as expected now.

The line should look something like "libby_token": "eyJ0eX", (except the token will be hundreds of characters long. )
The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json To get to it you could also open Calibre, go to Preferences, Miscellaneous, Open Calibre Configuration Folder, then close the app when the folder opens.
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

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 chrome://extensions, enabling developer mode, then loading the extension as unpacked. Chrome likely had an issue with loading the packed extension because it wasn't signed by Google.

@TheBookishDad
Copy link

TheBookishDad commented Aug 23, 2024

Someone found a solution (temporarily).

1. In your browser, open your dev console (ctrl-shift-I or F12 for me).
2. Go to the network tab, click the cog at the top-right and make sure "Persist Logs" is on.
3. Go to https://libbyapp.com/.
4. In the dev console, type "sentry" into the filter bar.
5. Click on the furthest-down entry that is a "GET" request.
6. In the right panel, go into the "Request Headers" and find "Authorization" -- its format should be "Bearer" followed by a long string of characters. Copy just the long string.
7. Make sure Calibre is closed, and open the plugin config file (%APPDATA%\calibre\plugins\overdrive_libby.json on Windows, unsure Mac/Linux paths).
8. Find the line for "libby_token", and replace its value with the one you copied in step 6.
9. Open Calibre and the plugin should work as expected now.

The line should look something like "libby_token": "eyJ0eX", (except the token will be hundreds of characters long.)
The path for the plugin config file for Mac would be /Users/USERNAME/Library/Preferences/calibre/plugins/overdrive_libby.json To get to it you could also open Calibre, go to Preferences, Miscellaneous, Open Calibre Configuration Folder, then close the app when the folder opens.
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

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 chrome://extensions, enabling developer mode, then loading the extension as unpacked. Chrome likely had an issue with loading the packed extension because it wasn't signed by Google.

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..

@sgmoore
Copy link

sgmoore commented Aug 23, 2024

That doesn't work either. when i try i get a missing manifest file or unreadable

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).
Then extracted it and looked inside that folder until I could see the manifest.json file.
Then went into edge, and open extensions and enabled "Developer mode" and selected "Load UnPacked"
It asked for a folder and I browsed to the folder that contained the manifest.json file. (The windows browser window at this point only shows folders and not files, so you can not actually see the manifest.json file to confirm you are in the correct folder, but you should be able to see a sub-folder called icons.

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.

@simon-techkid
Copy link

That doesn't work either. when i try i get a missing manifest file or unreadable

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). Then extracted it and looked inside that folder until I could see the manifest.json file. Then went into edge, and open extensions and enabled "Developer mode" and selected "Load UnPacked" It asked for a folder and I browsed to the folder that contained the manifest.json file. (The windows browser window at this point only shows folders and not files, so you can not actually see the manifest.json file to confirm you are in the correct folder, but you should be able to see a sub-folder called icons.

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?

@sgmoore
Copy link

sgmoore commented Aug 23, 2024

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

I am a ex-Chrome (now Firefox) user

Interesting. If you only started this extension yesterday, why choose to do it in Chrome rather than FireFox ?

@Udoachim
Copy link

Udoachim commented Sep 3, 2024

Until now, manually retrieving the token worked for me, but since today the loans do not show up anymore as downloadable entries under "Loans". When clicking on the sync button, the line at the bottom reads the correct amount of loans and holds, but nothing shows up for download.
Screenshot 2024-09-03 110559

@sgmoore
Copy link

sgmoore commented Sep 3, 2024

Would the debug mode help to narrow down what makes this book special?

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.
Most books are also available as either a epub or pdf and these can be downloaded. You can test that theory by logging into the libbyapp website or your library and see if you can download it there.

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.

@p1nkyy
Copy link

p1nkyy commented Sep 25, 2024

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

@SeriousHornet
Copy link

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.

@ColorfulQuark
Copy link

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.

@p1nkyy
Copy link

p1nkyy commented Oct 20, 2024

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?

@ColorfulQuark
Copy link

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.

@simon-techkid
Copy link

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.

@sgmoore
Copy link

sgmoore commented Oct 22, 2024

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 ?

@simon-techkid
Copy link

Is this going to be written in python?

Python is the way to go for calibre integration, but that will take a backseat until http requests are working.

On another topic, may I ask why you archived https://github.com/simon-techkid/LibbyApp-Token ?

Token requests using OverDrive website aren't working for Libby Calibre plugin any longer, AFAIK.

@sgmoore
Copy link

sgmoore commented Oct 22, 2024

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.
The only change since I started using it seems to be that the token used to be refreshed when syncing which meant that if you used the calibre plugin every week you didn't need to use your extension. That no longer happens and you have to keep getting a new token every week. That actually makes your extension even more valuable.

@simon-techkid
Copy link

That's great to hear, @sgmoore. I'll reopen the repo, and introduce support for automatically inserting the new token into the overdrive_libby.json config file. I'm glad to hear it's still working! It is possible there is something wrong with my firewall settings that is preventing Calibre from accessing the network, which I will investigate separately.

@p1nkyy
Copy link

p1nkyy commented Oct 23, 2024

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. The only change since I started using it seems to be that the token used to be refreshed when syncing which meant that if you used the calibre plugin every week you didn't need to use your extension. That no longer happens and you have to keep getting a new token every week. That actually makes your extension even more valuable.

Wait, really @sgmoore? I and one other people tried updating our token but it won't work!

@simon-techkid
Copy link

They have a functional fork.

@p1nkyy
Copy link

p1nkyy commented Oct 24, 2024

@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?

@sgmoore
Copy link

sgmoore commented Oct 24, 2024

@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?
If so I will have a further look.

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 .

print (f"status code: {res.status_code} Content Length : {len(res.content)}")

This returns an 403 and just one byte showing that the book is not actually being downloaded.

@p1nkyy
Copy link

p1nkyy commented Oct 24, 2024

Are you saying that the exact same token allows you to see your loans with this repo, but not the calibre plugin? If so I will have a further look.

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 .

print (f"status code: {res.status_code} Content Length : {len(res.content)}")

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.
If it's all the same then I'll just use the plugin as the UI's easier.

@simon-techkid
Copy link

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.

@p1nkyy
Copy link

p1nkyy commented Oct 25, 2024

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 😆
How to grab though? I dunno how to grab a commit, usually just Final Release.

@buske
Copy link

buske commented Oct 26, 2024

@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.

@sgmoore
Copy link

sgmoore commented Oct 26, 2024

@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).

Thanks. My token is due to expire in about six hours so I'll see how it handles it.

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.

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).

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.

Interesting. Are you saying you have a workaround but don't want to publish it?

@buske
Copy link

buske commented Oct 26, 2024

Thanks. My token is due to expire in about six hours so I'll see how it handles 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.

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).

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.

Interesting. Are you saying you have a workaround but don't want to publish it?

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.

@sgmoore
Copy link

sgmoore commented Oct 26, 2024

Great, let me know how it goes.

Worked perfectly. So thank you very much.

Looking at it now, it seems the expired token stays in the preferences file

I noticed that. It just means one extra request.

That's more than generous. I am happy to try to keep the boat afloat, but don't have capacity for quality-of-life maintenance.

So is that a yes, or a 'no thanks' ?

Yes, I'm concerned about publishing code that could be considered to bypass a technical protection measure.

Understood.

@buske
Copy link

buske commented Oct 26, 2024

Worked perfectly. So thank you very much.

Great, thanks!

So is that a yes, or a 'no 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.

@TheBookishDad
Copy link

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.

@buske
Copy link

buske commented Oct 26, 2024

@TheBookishDad It sounds like you're having a different issue than this one. Perhaps take a look at #30?

@TheBookishDad
Copy link

@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

@buske
Copy link

buske commented Oct 26, 2024

@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.

@sgmoore
Copy link

sgmoore commented Oct 26, 2024

I'd rather not, but if there's no one else,

OK.
I've made a little change to save the new token back to the json file and released this as v0.1.9.2 at https://github.com/sgmoore/libby-calibre-plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests