The forum

[Script] Amazon Kindle + DeDRM

Author Replies
jpath Sunday 2 June 2019 at 17:23

So I just bought a new Kindle eBook and was rather sad to learn that some wine update broke the Amazon Kindle application. The existing PlayOnLinux script does not work either and furthermore I also need the utility to extract the encryption keys from the Kindle application for use with the DeDRM Calibre plugin. I thought about fixing the existing Kindle script and making this like an addon to it, but who even wants to use this super old version of Kindle for anything other than downloading ebooks to strip the DRM off of them anyway?

This is my first PlayOnLinux script and it was very much a learning by doing thing, so if I did something stupid or not so nice, well.. colour me unsurprised.


# Date: 2019-06-02
# Last revision: 2019-06-02
# Author: Jan Path
# Script license: BSD3

[ "$PLAYONLINUX" = "" ] && exit 1
source "$PLAYONLINUX/lib/sources"

TITLE="Amazon Kindle + DeDRM"
# The current wine version (4.9) does not work. This one does.


POL_SetupWindow_free_presentation "$TITLE" \
 "This will install Amazon Kindle version 1.16  and the DeDRM utility to extract
 the encryption keys for use with the DeDRM calibre plugin. (Newer versions of
 Amazon Kindle do not work with wine)

 Once you logged into your Amazon account in the Kindle application you can run
 the “Extract Keys” utility created by this script. The extracted keys should be in

 It is probably a good idea to disable automatic updates after installation 
 under Tools > Options > General"

POL_Wine_SelectPrefix "$PREFIX"

POL_System_TmpCreate "$PREFIX"

cd "$POL_System_TmpDir"

# Python 2.7
POL_Download "" "912428345b7e0428544ec4edcdf70286"
POL_Wine_WaitBefore "Python 2.7"
POL_Wine msiexec /i "python-2.7.16.msi"
POL_Wine_WaitExit "Python 2.7"

# PyCrypto 2.6 for Python 2.7
POL_Download "" "e7875e7f6bf0b23701bdd5ef1d8679cd"
POL_Wine_WaitBefore "PyCrypto 2.6 for Python 2.7"
POL_Wine "pycrypto-2.6.win32-py2.7.exe"
POL_Wine_WaitExit "PyCrypto 2.6 for Python 2.7"

POL_Download "" "16b0bc2cc165db3215d0b6203bb0ab64"
unzip -u
mv "Other_Tools/DRM_Key_Scripts/Kindle_for_Mac_and_PC/kindlekey.pyw" "$WINEPREFIX/drive_c/"
POL_Shortcut 'Python27/python.exe' 'DeDRM Extract Amazon Kindle Keys' '' 'C:\\kindlekey.pyw'

# Amazon Kindle
POL_Download "" "92f8b55a17a632e77bcd94f7d7e767fc"
POL_Wine_WaitBefore "Amazon Kindle"
POL_Wine "KindleForPC-installer-1.16.44025.exe"
# I don't really know what this does or if it is important. 
# I just copied it from the existing Kindle script. I will have to test
# whether removing it makes a difference
rm "$WINEPREFIX/drive_c/windows/winsxs/manifests/x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4148_none_deadbeef.manifest"
POL_Wine_WaitExit "Amazon Kindle"
POL_Shortcut "Kindle.exe" "Amazon Kindle"


Edited by jpath

Dadu042 Wednesday 5 June 2019 at 7:13

Seems OK to me.


You just have to replace :

[ "$PLAYONLINUX" = "" ] && exit 1

[ "$PLAYONLINUX" = "" ] && exit 0

And :


exit 0

See also (useful) :


Edited by Dadu042