apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.49k stars 1.5k forks source link

de drm works on awz3 but not azw files #1222

Open danoreo opened 4 years ago

danoreo commented 4 years ago

Running Peppermint Linux 64 bit. running calibre in native linux mode. Runnig kindle reader via wine on playonlinux. all ebooks dlownload are open properly in kindle reader. de drm converts titles in azw3 format to other formats (Mobi or Epub) de drm fails to convert ebooks in azw format.

ElleKayEm commented 4 years ago

Let's see a log:

https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md#i-cannot-solve-my-problem-with-the-dedrm-plugin-and-now-i-need-to-post-a-log-how-do-i-do-that

danoreo commented 4 years ago

Log as requested. loaded one of each azw3 and azw ebooks.

(python2.7:9351): GLib-GIO-CRITICAL **: 18:20:45.316: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(python2.7:9351): GLib-GIO-CRITICAL **: 18:20:45.317: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile calibre Debug log calibre 3.21 embedded-python: False is64bit: True Linux-5.4.0-42-generic-x86_64-with-Peppermint-10-bionic Linux ('64bit', '') ('Linux', '5.4.0-42-generic', '#46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020') Python 2.7.17 Linux: ('Peppermint', '10', 'bionic') Interface language: None Successfully initialized third party plugins: DeDRM (6, 8, 0) calibre 3.21 embedded-python: False is64bit: True Linux-5.4.0-42-generic-x86_64-with-Peppermint-10-bionic Linux ('64bit', '') ('Linux', '5.4.0-42-generic', '#46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020') Python 2.7.17 Linux: ('Peppermint', '10', 'bionic') Interface language: None Successfully initialized third party plugins: DeDRM (6, 8, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 95.9160839161 physicalDpi: 81.5518394649 x 81.6428571429 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.12] splash screen shown [0.12] Initializing db... [0.13] db initialized [0.13] Constructing main UI... Failed to create system tray icon, your desktop environment probably does not support the StatusNotifier spec https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/ Looking for desktop notifier support from: org.freedesktop.Notifications org.freedesktop.Notifications found in 0.0 seconds [1.02] main UI initialized... [1.02] Hiding splash screen DeDRM v6.8.0: Trying to decrypt B07PXP9W9L_EBOK.azw Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: Black Amazon of Mars (Illustrated Stark) Found 0 keys to try after 0.2 seconds Crypto Type is: 0 This book is not encrypted. Decryption succeeded after 0.2 seconds DeDRM v6.8.0: Finished after 0.3 seconds [13.01] splash screen hidden [13.01] Started up in 13.01 seconds with 1 books DeDRM v6.8.0: Trying to decrypt B07WZ4QNYY_EBOK.azw Using Library AlfCrypto DLL/DYLIB/SO MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Mobipocket 6 ebook: The Contingency (The Contingency War Book 1) Found 0 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v6.8.0: Failed to decrypt with error: No key found in 0 keys tried. DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.8.0: Running kindlekey.py under Wine DeDRM v6.8.0: Command line: 'wine python.exe "/home/todd/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/todd/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"' Added Black Amazon of Mars (Illustrated Stark) to db in: 1.2 Added 1 books in 2.3 seconds wine: cannot find L"C:\windows\system32\python.exe" DeDRM v6.8.0: Found and decrypted 0 key files DeDRM v6.8.0: Ultimately failed to decrypt after 5.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 171, in _run_filetype_plugins nfp = plugin.run(nfp) or nfp File "calibre_plugins.dedrm.init", line 625, in run File "calibre_plugins.dedrm.init", line 575, in KindleMobiDecrypt DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 5.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile

(python2.7:9605): GLib-GIO-CRITICAL **: 18:21:45.792: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

(python2.7:9605): GLib-GIO-CRITICAL **: 18:21:45.793: g_dbus_proxy_new: assertion 'G_IS_DBUS_CONNECTION (connection)' failed Added The Contingency (The Contingency War Book 1) to db in: 1.5 Added 1 books in 7.5 seconds Worker Launch took: 0.0890259742737 This tool has been deprecated, use 'gio open' instead. See 'gio help open' for more info.

(xed:9664): Gdk-CRITICAL **: 18:21:55.719: gdk_window_get_window_type: assertion 'GDK_IS_WINDOW (window)' failed

ElleKayEm commented 4 years ago

The book that "worked" was already DRM-free to begin with. Otherwise, the problem is with DeDRM retrieving the key. You can see it tries in this part of the log:

DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.8.0: Running kindlekey.py under Wine DeDRM v6.8.0: Command line: 'wine python.exe "/home/todd/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/todd/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"'

But fails because:

wine: cannot find L"C:\windows\system32\python.exe"

You might be able to run that key script from the command line yourself, and then import the key. Another workaround would be temporarily installing Windows calibre with DeDRM where you have Kindle for PC setup. Decrypt a book with that, save the key, and import it into the DeDRM plugin installed in Linux calibre.

(By the way, I notice that version of calibre is pretty old, but it's probably not really an issue.)

cpiber commented 4 years ago

By far the easiest is to use winetricks python26 to install python. You can then use wine regedit to modify the PATH (you need to manually add python) to make it available to calibre (in cmd). https://wiki.winehq.org/Wine_User's_Guide#Setting_Windows.2FDOS_environment_variables No need for a full calibre install.