noDRM / DeDRM_tools

DeDRM tools for ebooks
7.29k stars 323 forks source link

DeDRM tool not removing DRM under Linux #67

Open Kodar-le-dok opened 2 years ago

Kodar-le-dok commented 2 years ago

Question / bug report

I have bought the digital version of a book from the Ellipses editor and I cannot manage to remove the DRM using your tool, with the last version of Calibre under Debian testing. The digital books from this editor are .acsm files, which are to be managed with Adobe Digital Editions. My computer runs Debian "bookworm" and, as suggested here, I installed Adobe Digital Editions 2.0.1 on my Wine API. The main problem appears to be getting the key while loading the book in Calibre:

DeDRM v10.0.2: Found and decrypted 0 key files
DeDRM v10.0.2: No ADE key found

The installation process I have used is actually described here.

Which version of Calibre are you running?

5.40

Which version of the DeDRM plugin are you running?

10.0.2

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

No response

Log output

calibre Journal de débogage
calibre 5.40  embedded-python: False is64bit: True
Linux-5.16.0-6-amd64-x86_64-with-glibc2.33 Linux ('64bit', 'ELF')
('Linux', '5.16.0-6-amd64', '#1 SMP PREEMPT Debian 5.16.18-1 (2022-03-29)')
Python 3.10.4
Interface language: fr
Successfully initialized third party plugins: DeDRM (10, 0, 2)
calibre 5.40  embedded-python: False is64bit: True
Linux-5.16.0-6-amd64-x86_64-with-glibc2.33 Linux ('64bit', 'ELF')
('Linux', '5.16.0-6-amd64', '#1 SMP PREEMPT Debian 5.16.18-1 (2022-03-29)')
Python 3.10.4
Interface language: fr
Successfully initialized third party plugins: DeDRM (10, 0, 2)
Not controlling automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.28430404738401 x 96.30554089709761
physicalDpi: 141.7674418604651 x 141.4020618556701
Using calibre Qt style: True
[0.00] Starting up...
[0.01] Showing splash screen...
[0.11] splash screen shown
[0.11] Initializing db...
[0.12] db initialized
[0.12] Constructing main UI...
[0.65] main UI initialized...
[0.65] Hiding splash screen
Starting QuickView
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 979, resource id: 23072596, major code: 40 (TranslateCoords), minor code: 0
Qt: Session management error: networkIdsList argument is NULL
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2355, resource id: 23072601, major code: 40 (TranslateCoords), minor code: 0
DeDRM v10.0.2: Trying to decrypt Spécialité NSI (Numérique et sciences informatiques)  30 leçons -2.pdf
DeDRM v10.0.2: Spécialité NSI (Numérique et sciences informatiques)  30 leçons -2.pdf is a PDF ebook for UUID 02619742-a3fe-4a62-bae7-e9c77c3c7d3b
DeDRM v10.0.2: Looking for new default Adobe Digital Editions Keys after 0.3 seconds
[2.47] splash screen hidden
[2.47] Started up in 2.47 seconds with 9 books
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

00c0:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
00dc:fixme:process:SetProcessShutdownParameters (00000380, 00000000): partial stub.
0094:fixme:imm:ImeSetActiveContext (0x4ad070, 0): stub
0094:fixme:imm:ImmReleaseContext (00010020, 004AD070): stub
0120:fixme:imm:ImeSetActiveContext (0x4b9758, 1): stub
0120:fixme:imm:ImmReleaseContext (00020046, 004B9758): stub
0110:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFA, 0021F544
DeDRM v10.0.2: Python3 exec found as wine py.exe -3
DeDRM v10.0.2: Running adobekey.py under Wine
0140:fixme:imm:ImeSetActiveContext (0x4b9758, 1): stub
0140:fixme:imm:ImmReleaseContext (00030052, 004B9758): stub
0130:fixme:kernelbase:AppPolicyGetProcessTerminationMethod FFFFFFFA, 0021F544
DeDRM v10.0.2: Wine subprocess call error: 1
DeDRM v10.0.2: Found and decrypted 0 key files
DeDRM v10.0.2: No ADE key found
Traceback (most recent call last):
  File "calibre_plugins.dedrm.config", line 35, in checkForDeACSMkeys
    from calibre_plugins.deacsm.libadobeAccount import exportAccountEncryptionKeyDER, getAccountUUID
ModuleNotFoundError: No module named 'calibre_plugins.deacsm'
DeDRM v10.0.2: Ultimately failed to decrypt after 4.3 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 "/usr/lib/calibre/calibre/customize/ui.py", line 175, in _run_filetype_plugins
    nfp = plugin.run(nfp) or nfp
  File "calibre_plugins.dedrm.__init__", line 895, in run
    decrypted_ebook = self.PDFDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 770, in PDFDecrypt
    raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION, time.time()-self.starttime))
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.2: Ultimately failed to decrypt after 4.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
Traceback (most recent call last):
  File "/usr/lib/calibre/calibre/customize/ui.py", line 432, in get_file_type_metadata
    mi = plugin.get_metadata(stream, ftype.lower().strip())
  File "/usr/lib/calibre/calibre/customize/builtins.py", line 324, in get_metadata
    return get_metadata(stream)
  File "/usr/lib/calibre/calibre/ebooks/metadata/pdf.py", line 124, in get_metadata
    raise ValueError('Could not read info dict from PDF')
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
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 2520, resource id: 23072606, major code: 40 (TranslateCoords), minor code: 0
00dc:fixme:service:QueryServiceConfig2W Level 6 not implemented
00dc:fixme:service:QueryServiceConfig2W Level 6 not implemented
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 982, resource id: 23072624, major code: 40 (TranslateCoords), minor code: 0
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1148, resource id: 23072629, major code: 40 (TranslateCoords), minor code: 0
Added Spécialité NSI (Numérique et sciences informatiques) 30 leçons -2 to db in: 1.0
Added 1 books in 6.2 seconds
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
noDRM commented 2 years ago

Looks like there's been an issue with the Python install under Wine, and that's why it was unable to grab the ADE encryption keys from your Wine install.

Especially for Linux users, I'd suggest dropping ADE and using the ACSM Input plugin for Calibre instead - no more need for Wine and closed-source ADE. In order to use that with the book you already downloaded through ADE, you'll have to authorize the ACSM plugin with the same AdobeID as your ADE install (I hope you used an ADE ID and no machine authorization?). If you didn't authorize ADE with an AdobeID, you'll have to import the existing anonymous authorization into the ACSM plugin - but I'm not sure how well that'll work through Wine.

I should really update the FAQ and include a note about that plugin so people use that instead of ADE.