Open sorsasampo opened 5 years ago
Hello there,
I have tried editing the wineutils.py
code of the DeDRM.zip file before re-importing the plugin as a .zip into calibre, without success. My addition was:
if wineprefix != "" and os.path.exists(wineprefix):
cmdline = u"WINEPREFIX=\"{2}\" WINEPATH='C:\Python26;C:\windows\system32' wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
else:
EDIT: manual success by following what is below: Because the plugin seems to force the current folder prefix, I manually ran (without a second argument, as it fails to find the output path, so I have let it choose one):
$ wine python.exe "/home/name/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py"
searching for kinfoFiles in C:\users\name\Local Settings\Application Data
Found K4PC 1.9+ kinf2011 file: C:\users\name\Local Settings\Application Data\Amazon\Kindle\storage\.kinf2011
Decrypted key file using IDString '123456789...' and UserName 'abcdef12356...'
which put a kindlekey1.k4i
file as in
/home/name/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey1.k4i
I have moved the decrypted key into the folder expected by the plugin:
cp /home/name/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey1.k4i /home/name/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir
and re-ran calibre on the new book (remove the book from calibre before):
$ calibre book.azw3
...
DeDRM v6.6.1: Command line: 'wine python.exe "/home/name/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py" "/home/name/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir"'
wine: cannot find L"C:\\windows\\system32\\python.exe"
DeDRM v6.6.1: Found and decrypted 1 key file
DeDRM v6.6.1: Found 1 new key
MobiDeDrm v0.42.
...
Got DSN key from database default_key_1
Found 4 keys to try after 0.6 seconds
Crypto Type is: 2
File is encoded with PID xxxxxxxx.
Decrypting. Please wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . done
Decryption succeeded after 4.4 seconds
DeDRM v6.6.1: Saving 1 new key
DeDRM v6.6.1: Finished after 4.5 seconds
WINEPATH='C:\Python26;C:\windows\system32'
Shouldn't the backslashes be quoted here (\\
)?
setting WINEPATH sounds like a good idea. Can you do a pull request with this addition to the code?
WINEPATH='C:\Python26;C:\windows\system32'
Shouldn't the backslashes be quoted here (
\\
)?
That could be, I thought that the single slashes were enough, but I may be wrong. I do not have the software to check at the moment.
winetricks python26
by defaults installspython.exe
toC:\python26\python.exe
.However, DeDRM runs it without path:
This should be easy to to fix, by setting
WINEPATH
to contain all usual directories wherepython.exe
is installed. For example:BTW, there is now a Lutris installer script for ADE 2.0.1: https://lutris.net/games/adobe-digital-editions/