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

KeyError: 'BookMetadata' #15

Open
Madam-Mim opened this issue Dec 2, 2019 · 4 comments
Open

KeyError: 'BookMetadata' #15

Madam-Mim opened this issue Dec 2, 2019 · 4 comments

Comments

@Madam-Mim
Copy link

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?

@jmvermeulen
Copy link

Check out my PR for this fix.

@Madam-Mim
Copy link
Author

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'

@crozo5
Copy link

crozo5 commented Feb 21, 2020

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

@subdavis
Copy link

subdavis commented Apr 4, 2020

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

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

4 participants