Can not upload metadata changes to DRM epub to Kobo

Issue #1 resolved
Victoria Lee
created an issue

Since upgrading to the latest edition of Calibre (3.12), I can no longer edit the metadata for DRM files and have the book upload to my Kobo Aura One (4.6.9995). I am using version 3.0.0 of the plugin. This used to work. The books that were previously uploaded are fine and I can read them. I can read the books on my PC. I am authenticated to Adobe Digital Editions on the Kobo and on my PC. This is the error message I receive.

calibre, version 3.12.0 ERROR: Error: Error communicating with device

This file is locked with DRM. It cannot be edited.

Traceback (most recent call last): File "site-packages\calibre\gui2\device.py", line 87, in run File "site-packages\calibre\gui2\device.py", line 591, in _upload_books File "calibre_plugins.kobotouch_extended.device.driver", line 389, in upload_books File "site-packages\calibre\devices\kobo\driver.py", line 2017, in upload_books File "calibre_plugins.kobotouch_extended.device.driver", line 197, in _modify_epub File "site-packages\calibre\ebooks\oeb\polish\container.py", line 1173, in init File "site-packages\calibre\ebooks\oeb\polish\container.py", line 1245, in process_encryption DRMError: This file is locked with DRM. It cannot be edited.

I am not trying to edit the actual book, just the metadata so I can have the author/title show as I wish.

I will need to purchase a new DRM book to run into the bug again. To fix this, I logged out of my account on the Kobo which essentially resets the device. After this, I only had 7 DRM books that wouldn't transfer so I manually copied them using Windows Explorer. The Kobo figured out they were there, so I then copied them from the Kobo to my library (deleting the originals). Very convoluted but all my books are now transferred and getting all the metadata I expect.

Thank you!

Comments (6)

  1. jgoguen repo owner

    Unfortunately being authenticated to ADE won't affect what you can do in calibre. But you should be able to send the book to your device if you have the option selected to upload DRM-encumbered files, you just won't be able to actually do anything with them. I'll see if I can dig up why it's not allowing you to do even that much.

    If you do get a DRM-encumbered book that you can't upload before I get this fixed, upload it at https://www.dropbox.com/request/YhdH9Quy2zOBnjGamQxZ so I have one to verify with.

  2. Victoria Lee reporter

    I had to completely rebuild my PC this past week so all my programs were reinstalled. I might have actually hit a Kobo bug. Once everything was loaded (as per above), I picked a book, and deleted it from my PC and device completely. I then redownloaded the DRM epub from Kobo to my PC and added it to Calibre. This time it uploaded to the Kobo once I connected my device. I also noticed that I regained 2GB of space on my Kobo and I have no idea how as all my books are loaded on it and the test book was very small. I am also not sure when this happened. It might have been when I logged myself out of Kobo on the Kobo Aura One. Possible junk on the Kobo?

  3. jgoguen repo owner

    This is almost definitely a change in calibre, but it's exposed by my use of calibre code based on how it used to work. When loading an ePub file, calibre creates a container object internally. While creating that object, it scans through the file encryption.xml inside the book file and checks all the in-use encryption algorithms. If any single one of them is not something it can work with (Adobe obfuscation (http://ns.adobe.com/pdf/enc#RC) or IDPF obfuscation (http://www.idpf.org/2008/embedding)) it raises an error. In my plugin I have a thin wrapper around that object; when processing books I would create the container and then ask if it's encumbered by DRM (it used to not raise an error during object initialization) and either add it to a list of books to skip processing or raise my own error based on the plugin setting.

    I think this should be fairly simple to work around, but I'm only working on this in my spare time so it may take a while to actually put a fix together and test it.

  4. Victoria Lee reporter

    I understand that this is a hobby for you and I thank you for all the work you've put into the plugin. I am a miserable programmer so I have nothing but the utmost respect for those who can code.

  5. Log in to comment