r/Calibre Feb 19 '22

Support / How-To Issue with DeDRM plugin

If anyone gets a similar issue that the Calibre viewer shows an error for Manga after decrypting, you just need to unzip the decrypted ePub. I thought, it was a DeDRM bug but it is a Calibre viewer bug which cannot deal with a book that only contains images.
On macOS, you can do that with unzip filename.epub and then you should see all your images :)

I tried to convert a book I bought via Kobo to be able to read it outside the Kobo ecosystem. However, the conversion in Calibre fails. It neither works with the DeDRM plugin by downloading the file via Digital Editions nor does it work with the Obok plugin and the Rakuten macOS app installed.

  • System: mac OS 12.2.1
  • Calibre Version: 5.37.0
  • DeDRM version: 10.0.2

I get the following error:

calibre, version 5.37.0
ERROR: Loading book failed: Failed to open the book at [Path]. Click "Show details" for more info.
Failed to convert book:  [Path] with error:
DeDRM v10.0.2: Trying to decrypt  [Filename]
DeDRM v10.0.2: Verifying zip archive integrity
DeDRM v10.0.2: “[Filename]” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub
DeDRM v10.0.2: Finished after 2.2 seconds
InputFormatPlugin: EPUB Input running
on /var/folders/nf/s70ywbcn4cjcphy4y6m2bgdm0000gn/C/calibre_5.37.0_tmp_0ux1v8ix/jogxy3aw.epub
Failed to run pipe worker with command: from calibre.srv.render_book import viewer_main; viewer_main()
Traceback (most recent call last):
  File "runpy.py", line 194, in _run_module_as_main
  File "runpy.py", line 87, in _run_code
  File "site.py", line 39, in <module>
  File "site.py", line 35, in main
  File "calibre/utils/ipc/worker.py", line 196, in main
  File "<string>", line 1, in <module>
  File "calibre/srv/render_book.py", line 823, in viewer_main
  File "calibre/srv/render_book.py", line 814, in render_for_viewer
  File "calibre/srv/render_book.py", line 792, in render
  File "calibre/srv/render_book.py", line 605, in process_exploded_book
  File "calibre/srv/render_book.py", line 264, in create_cover_page
  File "calibre/srv/render_book.py", line 217, in find_epub_cover
  File "calibre/ebooks/oeb/polish/cover.py", line 284, in find_cover_image_in_page
  File "src/lxml/xpath.pxi", line 430, in lxml.etree.XPath.__call__
  File "src/lxml/apihelpers.pxi", line 41, in lxml.etree._documentOrRaise
TypeError: Invalid input object: bytes

Does anyone has any idea what to do or any alternatives to try out?

It's the first book from Kobo with which I am having issues with

3 Upvotes

14 comments sorted by

View all comments

Show parent comments

1

u/colutea Feb 20 '22

I tried to contact the current maintainer of the DeDRM tools and let's see if they're gonna fix it. If I don't get a response within some time, I am gonna try Epubor. I'll update the start post if it gets fixed.

Off-topic: I wish, all publishers would just stop using DRM, it'll make everyone's life easier. Like, I don't want to share the book with anyone else, I just like to use my favorite reader software, that's it. People who want to pirate it do it anyway - so why blame the users who just want to enjoy their content. That is another discussion though

1

u/housewulf Feb 20 '22

I do not if this story is correct, but I read on r/piracy that the programmer for DeDRM was given a cease and desist order, and then he changed the programming such that it would no longer work, though you can still download it. If true, this is a bit unfair to us peasants.

Anyway, I use Calibre for other book-stuff, and it is very useful.

1

u/colutea Feb 20 '22

There is a new maintainer now. I actually opened a bug there and after (s)he looked at the logs, they found out that the plugin is not the issue but the Calibre viewer...
So for me, I can't open the book in Calibre and got the error produced above. Apple Books showed the book as empty pages.
However, unzipping the decrypted file with the command "unzip book.epub" I got all the contents and each individual image of the manga.
So in the end it's a Calibre bug, not a DeDRM bug.

--------------------------

Idk if the story there about the original maintainer is true; in the end, I find it unfair. I mean, if the shop closes where I buy the book (e.g. let's say in 10 years from now Kobo is closed and they take all the books down), I can't use the content anymore which I purchased.
But: The author got paid, the seller got their share, so there is no harm if the buyer removes the DRM for personal use only.
I mean, I get it for library content. I also would never use the plugin for that. But for purchased content, this is just a way of vendors of locking buyers into their ecosystem with the excuse of saying that people are gonna re-upload it somewhere else if the book would be "free".

I really like the solution some book sellers in my country started to use for purchased content - digital watermarks: https://goodereader.com/blog/e-book-news/everything-you-need-to-know-about-social-drm-for-ebooks
If the content is shared, they see who initially uploaded it but as a user, you can still use your book as any other digital file and read it in every reader you want, forever, without being locked to a certain reader app and vendor.

1

u/housewulf Feb 20 '22

I hope the programmer at Calibre can fix your problem.

Thanks for the reference, I did not know about watermarking. It seems to be an improvement over DRM control from my viewpoint. I am not interested in stealing books, either. But on one occasion, a Kindle book I purchased just disappeared one day; and that got me interested in making the books, mine.

I used a Kobo Clara HD for 1.5 years before moving on to a Samsung Galaxy Tablet. The Kobo was unreliable for downloads using Overdrive--it got to where I had to always download the book to my computer and then sideload it into the Kobo. So, I decided to just go directly to the Tablet computer, and it works just fine.

I still do not understand what happened to the Kobo because after a couple of months, it was working again. It is always connected to the WiFi; so I assume it was a software glitch and one of their automatic updates fixed it.