Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gstalnaker opened this issue Oct 24, 2024 · 12 comments

Comments

@gstalnaker
Copy link

Question / bug report

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

  • In Calibre PlugIn preferences can select deDRM and the Calibre "Customize plugin" button
  • "Customize deDRM" dialog opens.
  • Enter Wine prefix path "/home/xxxxx/.local/share/wineprefixes/Wine32/" and click on Add (+) control button and nothing happens.
  • Confirm ADE v2 is installed in that prefix path, and that it runs, and shows a configured AdobeID plus shows added epub files.
  • There's no error.

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
Copy link

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
Copy link
Author

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.

  • I have python3 installed under wine which gets me pip
    • Z:\home\guyst>python --version - Python 3.7.6
    • pip --version - pip 19.2.3 from c:\users\guyst\AppData\Local\Programs\Python\python37-32\lib\site-packages\pip (python 3.7)
  • Attempting to use pip install pycryptodome from a cmd.exe shell results in an error about MS Visual Studio C++ v14.0.
  • I can discover no way to successfully install MS C++ Build Tools so that it's available to this pip install.
    • Every .exe I can find via net search either fails to install by every method I use (wine cmd /c or in a cmd.exe command shell).
    • -OR- If I can get what I think is the right package installed in either a 32-bit or 64-bit Wine they do not produce the desired effect and the error shown below continues
    • Packages attempted:
      • visualcppbuildtools_full.exe
      • VisualStudioSetup.exe
      • vs_BuildTools.exe
      • VS_RemoteTools.exe
      • VSCodeSetup-x64-1.94.2.exe
    • All of the C++ redistributables available in winetricks apparently do not provide sufficient libraries to get that pip install to successfully complete either.
  • Attempting to build from source from a cmd shell with 'python setup.py' from the source folders produces the same MS Visual Studio C++ v14.0 error

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
Copy link

Have you tried using the DeACSM plugin instead of ADE?

@gstalnaker
Copy link
Author

gstalnaker commented Oct 25, 2024

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
Copy link
Author

P.S. Thanks ElleKayEm for responding!

@gstalnaker
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link

C0rn3j commented Oct 27, 2024

(python 3.7)

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

It may be messing things up.

@noDRM
Copy link
Owner

noDRM commented Nov 10, 2024

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
Copy link

auspex commented Nov 23, 2024

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 :-)

@haevalencia
Copy link

Hi everyone! Thanks to this thread I discovered Calibre ACSM Input plugin (aka DeACSM) and it works perfectly. I was finally able to get rid of using Digital Edition in Wine.

For those who want to insist on using Wine, the easiest way to use Digital Edition together with Calibre is by using Bottles. From there you can configure everything necessary to run digital edition with all the necessary dependencies. I currently use an immutable distro and only flatpak applications. Everything works fine.

Anyway, I recommend using ACSM Input plugin + DeDRM tools on GNU/Linux distros. I have used it on different distributions and it works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants