TnS-hun / kobo-book-downloader

A tool to download your purchased Kobo books and remove the DRM from them.
The Unlicense
252 stars 63 forks source link

KeyError: 'BookMetadata' #15

Open Madam-Mim opened 4 years ago

Madam-Mim commented 4 years ago

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 commented 4 years ago

Check out my PR for this fix.

Madam-Mim commented 4 years ago

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 commented 4 years ago

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

subdavis commented 4 years ago

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:

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