noDRM / DeDRM_tools

DeDRM tools for ebooks
7.43k stars 325 forks source link

Cannot open DeDRM'd file #105

Open florseib opened 2 years ago

florseib commented 2 years ago

Question / bug report

I bought a book from Google Play and opened the acsm file on Adobe Digital Editions 2.0. Then, I tried opening it on Calibre using the plugin, but when I try opening the PDF all I get is a screen that says "Error loading [file path]". This has happened occasionally in the past before but I never really sought out any help, since it was rather sporadic.

EDIT: Just to add, cause I think it might be important, I first tried opening it using Apprentice Alf's DeDRM (I didn't know it was out of date) and Calibre 5.44. Then I googled to see if there was a new version and switched, since it wasn't working.

Which version of Calibre are you running?

6.1.0, but I also reverted to 5.44 to test and had the same result

Which version of the DeDRM plugin are you running?

10.0.3

If applicable, which version of the Kindle software are you running?

No response

Log output

calibre Debug log calibre 5.44 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (10, 0, 3) calibre 5.44 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (10, 0, 3) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 101.6 x 101.6 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.74] splash screen shown [0.74] Initializing db... [0.75] db initialized [0.75] Constructing main UI... [1.62] main UI initialized... [1.62] Hiding splash screen Starting QuickView DeDRM v10.0.3: Trying to decrypt Varieties of Spanish in the United States.pdf DeDRM v10.0.3: Varieties of Spanish in the United States.pdf is a PDF ebook with encryption EBX_HANDLER DeDRM v10.0.3: Varieties of Spanish in the United States.pdf is a PDF ebook (EBX) for UUID 91874e2e-219f-4407-b803-f51deee57a29 DeDRM v10.0.3: Trying encryption key default_key DeDRM v10.0.3: Exception when decrypting after 0.2 seconds Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 724, in PDFIneptDecrypt File "C:\Users[real name]\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptpdf.py", line 2286, in decryptBook File "C:\Users[real name]\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptpdf.py", line 2094, in init File "C:\Users[real name]\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptpdf.py", line 1253, in initialize File "C:\Users[real name]\AppData\Roaming\calibre\plugins\DeDRM.zip\ineptpdf.py", line 1690, in initialize_ebx_inept ineptpdf.ADEPTError: error decrypting book session key DeDRM v10.0.3: Failed to decrypt with key default_key after 0.2 seconds DeDRM v10.0.3: Looking for new default Adobe Digital Editions Keys after 0.2 seconds DeDRM v10.0.3: Exception when getting default Adobe Key after 0.2 seconds Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 753, in PDFIneptDecrypt File "C:\Users[real name]\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 347, in adeptkeys File "C:\Users[real name]\AppData\Roaming\calibre\plugins\DeDRM.zip\adobekey.py", line 327, in CryptUnprotectData adobekey.ADEPTError: Failed to decrypt user key key (sic) DeDRM v10.0.3: Finished after 0.3 seconds Traceback (most recent call last): File "calibre\customize\ui.py", line 432, in get_file_type_metadata File "calibre\customize\builtins.py", line 324, in get_metadata File "calibre\ebooks\metadata\pdf.py", line 124, in get_metadata ValueError: Could not read info dict from PDF Syntax Error: Couldn't find the 'EBX_HANDLER' security handler

pdfinfo errored out with return code: 1 [11.89] splash screen hidden [11.89] Started up in 11.89 seconds with 17 books stdout+stderr from file dialog helper: [b'', b''] piped data from file dialog helper: [b' \nJ\xfbD\xa4\xd6091jf\x8a\x17\xac\xfc\x95\xf7\x1b\xf4\xcb\x91\xd6)9\xfeg\x8b)U\x98\xb0', b'C:\Users\[real name]\Documents\My Digital Editions\Varieties of Spanish in the United States.pdf'] Added Varieties of Spanish in the United States to db in: 0.1 Added 1 books in 0.8 seconds

ElleKayEm commented 2 years ago

ADE 2 used to download the PDF is authorized with your Adobe ID and on the same machine and user as calibre with DeDRM?

florseib commented 2 years ago

Sorry, how exactly do I check if it's authorized?

EDIT: I clicked on Help > Authorize Device, it says it's authorized without an ID.

ElleKayEm commented 2 years ago

That's the issue. DeDRM works with your Adobe ID.

florseib commented 2 years ago

Okay, so do I just authorize ADE2 with my ID and that's it?

ElleKayEm commented 2 years ago

Should be done before opening the acsm file. Not sure what will happen since you've already downloaded the pdf without an ID. You might look at the ACSM Input plugin which bypasses ADE: https://www.mobileread.com/forums/showthread.php?t=341975

florseib commented 2 years ago

Thank you. Does deleting the file from the ADE folder not help? Regardless, I'll look into that plugin. Does it also remove DRM?

ElleKayEm commented 2 years ago

On the 1st question, Adobe says the book will be tied to that installation only: https://helpx.adobe.com/digital-editions/using/authorizing-and-de-authorizing-adobe-digital-editions.html#:~:text=If%20you%20choose%20to%20authorize,if%20you%20re%2Dinstall).

Not sure how that can be worked around -- haven't had that issue myself.

The ACSM Input plugin gets the epub or pdf. DeDRM is still removing the DRM.