apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.52k stars 1.51k forks source link

"DeDRM seeks keys in ..." missing in FAQ #1229

Closed fredvej closed 4 years ago

fredvej commented 4 years ago

Thank you for this excellent tool.

I have a suggestion for the documentation. Where the DeDRM tool searches for decryption keys is an important information that is missing in the installation guide. Please write that DeDRM must be used on the same machine where the DRM'ed media was downloaded, because DeDRM needs the decryption keys.

Here is why:

Puzzled why I could not remove DRM on Linux, I created a fresh virtual machine with Windows 10 and installed Calibre 4.23.0 portable and the DeDRM v6.8.0 plugin. When I tried "Save to Disk" to get a DRM-free copy, Calibre failed again with the same error message "Failed to update metadata in some books", so it was not a Linux vs Windows thing. The FAQs tells how to get Calibre to create a log, so I did that for all three platforms, and then the great AHA-moment came: when removing DRM from Adobe Digital Editions downloads, DeDRM looks for keys in the installed Adobe Digital Editions. That explains why Calibre cannot export the DRM'ed PDF on a different machine.

Successful export on Windows: DeDRM v6.8.0: Trying to decrypt 5672658.acsm.encrypted.pdf DeDRM v6.8.0: 5672658.acsm.encrypted.pdf is a PDF ebook DeDRM v6.8.0: Looking for new default Adobe Digital Editions Keys after 0.1 seconds Found 1 keys DeDRM v6.8.0: Trying a new default key DeDRM v6.8.0: Saving a new default key DeDRM v6.8.0: Saved a new default key after 3.0 seconds DeDRM v6.8.0: Finished after 3.0 seconds

Failed export on Windows: DeDRM v6.8.0: Trying to decrypt 5672658.acsm.encrypted.pdf DeDRM v6.8.0: 5672658.acsm.encrypted.pdf is a PDF ebook DeDRM v6.8.0: Looking for new default Adobe Digital Editions Keys after 0.1 seconds DeDRM v6.8.0: Exception when getting default Adobe Key after 0.1 seconds Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 453, in PDFDecrypt File "calibre_plugins.dedrm.adobekey", line 378, in adeptkeys ADEPTError: Adobe Digital Editions not activated DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 172, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 632, in run File "calibre_plugins.dedrm.init", line 507, in PDFDecrypt DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Syntax Error: Couldn't find the 'EBX_HANDLER' security handler pdfinfo errored out with return code: 1 Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 428, in get_file_type_metadata File "site-packages\calibre\customize\builtins.py", line 343, in get_metadata File "site-packages\calibre\ebooks\metadata\pdf.py", line 129, in get_metadata ValueError: Could not read info dict from PDF

Error message dialog box: calibre, version 4.23.0 WARNING: Error while saving: Failed to update metadata in some books, click "Show details" for more information

Failed to update the metadata in the PDF format of: 5672658.acsm.encrypted by Unknown, with error: Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 447, in set_file_type_metadata File "site-packages\calibre\customize\builtins.py", line 544, in set_metadata File "site-packages\calibre\ebooks\metadata\pdf.py", line 190, in set_metadata File "site-packages\calibre\utils\podofo__init.py", line 44, in set_metadata Exception: Failed to set PDF metadata in (5672658.acsm.encrypted): Traceback (most recent call last): File "site-packages\calibre\utils\ipc\simple_worker.py", line 308, in main File "site-packages\calibre\utils\podofo\init__.py", line 101, in setmetadata Error: ePdfError_UnsupportedFilter File: C:\t\t\podofo-85g0_j9q\src\base\PdfParser.cpp Line: 272 Unable to load objects from file. File: C:\t\t\podofo-85g0_j9q\src\base\PdfParser.cpp Line: 1070 Error while loading object 5873 0

File: C:\t\t\podofo-85g0_j9q\src\base\PdfEncrypt.cpp Line: 549 Unsupported encryption filter: EBX_HANDLER
ElleKayEm commented 4 years ago

Huh, I could have sworn this was already in the FAQs or help somewhere, but I don't see it now. With Adobe DRM, once you've retrieved that key, it can be used on any books associated with that same Adobe ID. So you can save the Adobe Digital Editions key from the DeDRM plugin in Windows calibre (once you successfully decrypted a book) and import it into DeDRM in your Linux calibre setup. Then you can decrypt books from whatever device you download Adobe DRM books with (as long as it is authorized with that same Adobe ID).

ElleKayEm commented 4 years ago

Okay, I found it in the DeDRM help file:

On Windows and Mac, the keys for ebooks downloaded for Kindle for Mac/PC and Adobe Digital Editions are automatically generated. If all your DRMed ebooks can be opened and read in Kindle for Mac/PC and/or Adobe Digital Editions on the same computer on which you are running calibre, you do not need to do any configuration of this plugin.

https://github.com/apprenticeharper/DeDRM_tools/blob/master/DeDRM_plugin/DeDRM_Help.htm

fredvej commented 4 years ago

Thank you ElleKayEm for the swift answers.

I use Calibre only for removing DRM from PDFs, so my familiarity with this program is very limited; after reading your answer I learned how to open a plugin's configuration dialog and from there the help file, I exprimented with clicking and double-clicking here and there and whoops, it popped up <:*) I did not even know that a plugin could be configured.

Before I installed Calibre I spent a very frustrating day trying to install Adobe Digital Editions (ADE) with winetricks and wine. I learned how to make a 32 bit wine environment, and that winetricks could not install .NET 4.0 nor ADE, and neither could I. So I decided to run ADE in a virtual Windows machine and have Calibre on Linux. Then I spent half a day to learn what resulted in this issue. Oh well, time is not completely wasted if one learns something ;-)

Now I use the virtual Windows machine for both ADE and Calibre with DeDRM, and it works just fine. My Linux is cleaned from wine, ADE and Calibre, as I had no other use for that than removing PDF-DRM.

Should I close this issue or keep it open untill you decide if the install guide should be changed?

ElleKayEm commented 4 years ago

If you're all set, you can close the issue.

fredvej commented 4 years ago

Thank you