kobo-book-downloader icon indicating copy to clipboard operation
kobo-book-downloader copied to clipboard

KeyError: 'BookMetadata'

Open Madam-Mim opened this issue 5 years ago • 4 comments

Love kobo-book-downloader and the way it simplifies downloading and removing DRM from Kobo books. Had a problem using it just now for the first time in a month or two. Get the following errors when using any of the commands: For example, jenny@jenny-PC:~/kobo-book-downloader-master$ python kobo-book-downloader pick /home/jenny/ --all gives the following: Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "kobo-book-downloader/main.py", line 82, in Main() File "kobo-book-downloader/main.py", line 75, in Main Commands.PickBooks( arguments.OutputPath, arguments.all ) File "kobo-book-downloader/Commands.py", line 288, in PickBooks rows = Commands.__GetBookList( listAll ) File "kobo-book-downloader/Commands.py", line 199, in __GetBookList bookMetadata = newEntitlement[ "BookMetadata" ] KeyError: 'BookMetadata'

Have tried downloading the code again and also deleting and regenerating the .config/kobo-book-downloader.json file and it gives the same errors. Any suggestions?

Madam-Mim avatar Dec 02 '19 09:12 Madam-Mim

Check out my PR for this fix.

jmvermeulen avatar Dec 02 '19 14:12 jmvermeulen

Thanks, Tried your PR change and it works for getting the directory listing of my books. Saw the DRM problem you describe. My python skills are zero, so can't help with that.

**Traceback (most recent call last): File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "kobo-book-downloader/main.py", line 82, in Main() File "kobo-book-downloader/main.py", line 69, in Main Commands.GetBookOrBooks( arguments.RevisionId, arguments.OutputPath, arguments.all ) File "kobo-book-downloader/Commands.py", line 162, in GetBookOrBooks Commands.__GetBook( revisionId, outputPath ) File "kobo-book-downloader/Commands.py", line 113, in __GetBook Globals.Kobo.Download( revisionId, None, Kobo.DisplayProfile, outputPath ) File "kobo-book-downloader/Kobo.py", line 333, in Download downloadUrl, hasDrm = Kobo.__GetDownloadInfo(productId, jsonResponse) File "kobo-book-downloader/Kobo.py", line 299, in __GetDownloadInfo if jsonContentUrl[ "DrmType" ] == "SocialDrm" and (jsonContentUrl["Format"] == "WATERMARK"): KeyError: 'DrmType'

Madam-Mim avatar Dec 03 '19 11:12 Madam-Mim

I have the same error. How do you fix that?

crozo5 avatar Feb 21 '20 19:02 crozo5

This repository has been abandoned. I have forked the project at https://github.com/subdavis/kobo-book-downloader - please give that project a try and open an issue there if you have trouble.

It adds some new features:

  • audiobook support
  • multi-user support; fetch books for multiple accounts.
  • web interface; adds new browser gui (with flask)
  • docker image
  • pypi package

Please don't reply to this issue, open an issue on my fork instead

subdavis avatar Apr 04 '20 21:04 subdavis