apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.55k stars 1.52k forks source link

Calibre plugin unable to convert epub without rights.xml file #342

Open kkoehler opened 7 years ago

kkoehler commented 7 years ago

I know there is another bug regarding the absence of a rights.xml file within Adobe Digital Edition files (#235), but i can not reopen it, so i create this one.

I have an epub file which does not contain a META-INF/rights.xml file. With Adobe Digitals Edition I'm able to open that file. With Calibre it fails. Calibre complains about DRM ;-) The import fails because of the missing rights.xml file.

According to the spec I found here: http://www.idpf.org/epub/30/spec/epub30-ocf.html i think it is possible to have an encrypted file without a rights.xml file. Also see the example: http://www.idpf.org/epub/30/spec/epub30-ocf.html#example

The DeDRM tool doesn't support this currently.

ElleKayEm commented 7 years ago

When the rights.xml isn't inside the epub, the information is stored elsewhere. For example, with Nook books downloaded with the Windows store app, it's stored in a database. Don't know where ADE stores it. I suppose a tool could be built to find the info. However, I think you should be able to download a version of the epub with rights.xml already in it. For Adobe DRM, download it by opening an acsm file in ADE 2.0.1. For B&N epubs, use Nook for PC.

apprenticeharper commented 7 years ago

"When the rights.xml file is not present, the OCF container provides no information indicating any part of the container is rights governed."

Without a rights.xml, DRM should not have been applied.

kkoehler commented 7 years ago

Ok. The file i have doesn't contain a rights.xml and calibre complains about DRM. If i extract the epub und look into an *xhtml file within the "OEBPS/Text" folder, it seems to be encrypted... I'm able to open that file with ADE (mean the whole epub).

How can I open that file (with calibre)?

ElleKayEm commented 7 years ago

Then it has a rights.xml. It's just not inside the epub container. You can download a copy that has the file in it already. Or find where it's stored and put it back in.

kkoehler commented 7 years ago

Ok I found a solution:

I'm working on Linux. Using wine for ADE (version 1.7.x). At some point ADE stopped downloading the epubs. It presented a error with an url of the epub. This was the epub without a rights.xml.

So i started searching for the rights.xml but coulnd't find one. But i found a file within the "Temporary Internet Files" called "Fulfill[0]" within that file i found parts of the rights.xml (licenseToken element).

I found an article describing how to build a rights.xml (https://www.keypressure.com/blog/drm-jumping-through-hoops-please-adobe-gods/)

I created a new rights.xml file containing only the licenseToken element and it worked.

So there was no rights.xml but the information was there! ;-)

ElleKayEm commented 7 years ago

Wow -- good detective work! Might be something to file away in case ADE 2.0.1 starts behaving like 1.7.