noDRM / DeDRM_tools

DeDRM tools for ebooks
7.37k stars 324 forks source link

Cannot configure deDRM in Calibre for ADE under wine - deDRM appears to want a Windows Python.exe executable #660

Open gstalnaker opened 1 month ago

gstalnaker commented 1 month ago

Question / bug report

deDRM v10.0.9 Installs fine. Attempts to configure for Adobe DE fails or cannot be successfully concluded.

Restarted calibre in debug mode and find the log posted below that suggests that the the deDRM plugin is looking for a Windows python executable. I think this because the wineprefix path is shown in the log in this section and the only place it appears in Calibre is in the deDRM Customization dialog.

Is it supposed to do this? I don't recall reading anywhere I should have python installed in the wine prefix.

Which version of Calibre are you running?

7.17

Which version of the DeDRM plugin are you running?

10.0.9

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

No response

Log output

ApplicationPaletteChange event ignored
Using calibre Qt style: True
qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
calibre Debug log
calibre 7.17  embedded-python: True
Linux-6.10.10-surface-1-x86_64-with-glibc2.36 Linux ('64bit', 'ELF')
('Linux', '6.10.10-surface-1', '#1 SMP PREEMPT_DYNAMIC Sun Sep 15 03:41:08 UTC 2024')
Python 3.11.5
Interface language: None
EXE path: /opt/calibre/bin/calibre-debug
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 16, 0) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 16, 0) && KFX metadata reader (from KFX Input) (2, 16, 0) && From KFX (2, 16, 0) && KFX Input (2, 16, 0) && Set KFX metadata (from KFX Output) (2, 11, 0) && KFX Output (2, 11, 0) && Obok DeDRM (10, 0, 9)
calibre 7.17  embedded-python: True
Linux-6.10.10-surface-1-x86_64-with-glibc2.36 Linux ('64bit', 'ELF')
('Linux', '6.10.10-surface-1', '#1 SMP PREEMPT_DYNAMIC Sun Sep 15 03:41:08 UTC 2024')
Python 3.11.5
Interface language: None
EXE path: /opt/calibre/bin/calibre-debug
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 16, 0) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 16, 0) && KFX metadata reader (from KFX Input) (2, 16, 0) && From KFX (2, 16, 0) && KFX Input (2, 16, 0) && Set KFX metadata (from KFX Output) (2, 11, 0) && KFX Output (2, 11, 0) && Obok DeDRM (10, 0, 9)
QPA platform: xcb
devicePixelRatio: 1.75
logicalDpi: 96.0 x 96.0
physicalDpi: 112.89862068965516 x 114.83473684210526
[0.00] Starting up...
[0.00] Showing splash screen...
[1.09] splash screen shown
[1.09] Initializing db...
[1.32] db initialized
[1.32] Constructing main UI...
DEBUG:    0.0 obok::utilities.py - loading translations
DEBUG:    0.0 obok::dialogs.py - loading translations
DEBUG:    0.0 obok::config.py - loading translations
DEBUG:    0.0 obok::action_err.py - loading translations
[2.39] GUI main window shown
[2.44] main UI initialized...
[2.44] Hiding splash screen
[2.45] splash screen hidden
[2.45] Started up in 2.45 seconds with 4666 books
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
009c:fixme:hid:handle_IRP_MN_QUERY_ID Unhandled type 00000005
Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

Application could not be started, or no application associated with the specified file.
ShellExecuteEx failed: File not found.

wine: failed to open "C:\\Python27\\python.exe": c0000135
wine client error:6c: write: Bad file descriptor
DeDRM v10.0.9: wine py.exe -3 is not python3
DeDRM v10.0.9: wine python3.exe is not python3
DeDRM v10.0.9: wine python.exe is not python3
DeDRM v10.0.9: wine C:\Python27\python.exe does not exist
DeDRM v10.0.9: Unable to find python3 executable in WINEPREFIX="/home/xxxxx/.local/share/wineprefixes/Wine32/"
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
ElleKayEm commented 1 month ago

Yes, you need Python and Pycryptodome installed under Wine to run the key retrieval script.

An alternative is using the DeACSM plugin to download books directly into calibre instead of downloading them with ADE. You may have to manually save your key from DeACSM and import it into DeDRM.

gstalnaker commented 1 month ago

I assume, because using deDRM on Linux/wine is specifically mentioned in the documentation (and that ElleKayEm also mentions it), that pycryptodome is installable under Wine. Yet I cannot discover a way to do so.

Again, nothing I can download and use from that URL has proven successful.

So, if I can be a stupid human, can anyone explain how I can get pycryptodome under wine installed (either a 32-bit or 64-bit prefix) so I can use deDRM?

ElleKayEm commented 1 month ago

Have you tried using the DeACSM plugin instead of ADE?

gstalnaker commented 1 month ago

No joy with DeACSM after nearly two hours of effort. At first with the latest v0.0.16 there was a libcrypto error. I didn't have it installed. Installed it and the error changed to: 'AttributeError: module 'calibre_plugins.deacsm.prefs' has no attribute 'DeACSM_Prefs'.

So I cannot use DeDRM or DeASCM. Such is OpenSource life, no?

gstalnaker commented 1 month ago

P.S. Thanks ElleKayEm for responding!

gstalnaker commented 1 month ago

P.P.S - I have submitted an issue on the DeACSM github site. Will see what happens. Will leave this open for now and if there is progress there will report here so it's documented.

ElleKayEm commented 1 month ago

Install DeACSM from within calibre. On the main menu, click the Preferences drop down menu > Get plugins to enhance calibre. In the top right "Filter by name", put DeACSM. After you install it, restart calibre. (I haven't used DeASCM myself. I have a working setup on Windows with ADE and I'm not messing with it!)

gstalnaker commented 1 month ago

You're being very persistent in helping and I thank you. But, alas, the exact same error using the method you describe - "no attribute 'DeACSM_Prefs'. I may do as you describe - boot into Windows and see what I can do that way. Will require a new calibre install, but perhaps doing this solely for the Kindle/Kobo DRM'd books is worth that hassle as once I have them DRM-free I can shift back to my normal Linux desktop. Thanks again.

C0rn3j commented 1 month ago

(python 3.7)

Is there a reason you're running such dated version of Python?

It may be messing things up.

noDRM commented 2 weeks ago

I have definitely used the plugin under Linux in combination with Wine before, but yeah, it's a pain to set up and I don't remember exactly how it worked. And given that DeACSM exists (and works fine for most people) i don't think there's many people that are even still using this method.

For the DeACSM plugin, try using a newer beta version of that plugin (should be available somewhere on their github i believe?) or package it from source, that usually gets rid of these odd errors.

auspex commented 4 days ago

I've just installed a brand new version of Kindle for PC in Wine. The simple way is winetricks. If you ask it to install the kindle application, you get Python (and Gecko) alongside it (and presumably pycryptodome, because decryption works...).

Oh, darn. Of course you said ADE. But …. you could install the Kindle App, then ADE, then uninstall Kindle :-)