-K4MobiDeDRM_v04.4_plugin.zip
+K4MobiDeDRM_v04.5_plugin.zip
Credit given to The Dark Reverser for the original standalone script. Credit also to the many people who have updated and expanded that script since then.
description = 'Removes DRM from eInk Kindle, Kindle 4 Mac and Kindle 4 PC ebooks, and from Mobipocket ebooks. Provided by the work of many including DiapDealer, SomeUpdates, IHeartCabbages, CMBDTC, Skindle, DarkReverser, mdlnx, ApprenticeAlf, etc.'
supported_platforms = ['osx', 'windows', 'linux'] # Platforms this plugin will run on
author = 'DiapDealer, SomeUpdates, mdlnx, Apprentice Alf' # The author of this plugin
- version = (0, 4, 4) # The version number of this plugin
+ version = (0, 4, 5) # The version number of this plugin
file_types = set(['prc','mobi','azw','azw1','azw3','azw4','tpz']) # The file types that this plugin will be applied to
on_import = True # Run this plugin during the import
priority = 520 # run this plugin before earlier versions
print " Getting PIDs from WINE"
outfile = os.path.join(self.alfdir + 'winepids.txt')
+ # Remove any previous winepids.txt file.
+ if os.path.exists(outfile):
+ os.remove(outfile)
cmdline = 'wine python.exe ' \
+ '"'+self.alfdir + '/getk4pcpids.py"' \
print cmdline
- cmdline = cmdline.encode(sys.getfilesystemencoding())
- p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=sys.stdout, stderr=STDOUT, close_fds=False)
- result = p2.wait("wait")
- print "Conversion returned ", result
+ try:
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
+ p2 = Process(cmdline, shell=True, bufsize=1, stdin=None, stdout=sys.stdout, stderr=STDOUT, close_fds=False)
+ result = p2.wait("wait")
+ except Exception, e:
+ print "WINE subprocess error ", str(e)
+ return []
+ print "WINE subprocess returned ", result
+
WINEpids = []
- customvalues = file(outfile, 'r').readline().split(',')
- for customvalue in customvalues:
- customvalue = str(customvalue)
- customvalue = customvalue.strip()
- if len(customvalue) == 10 or len(customvalue) == 8:
- WINEpids.append(customvalue)
- else:
- print "'%s' is not a valid PID." % customvalue
+ if os.path.exists(outfile):
+ try:
+ customvalues = file(outfile, 'r').readline().split(',')
+ for customvalue in customvalues:
+ customvalue = str(customvalue)
+ customvalue = customvalue.strip()
+ if len(customvalue) == 10 or len(customvalue) == 8:
+ WINEpids.append(customvalue)
+ else:
+ print "'%s' is not a valid PID." % customvalue
+ except Exception, e:
+ print "Error parsing winepids.txt: ", str(e)
+ return []
+ else:
+ print "No PIDs generated by Wine Python subprocess."
return WINEpids
def is_customizable(self):
for candidate in zf.namelist():
if candidate in names:
ans[candidate] = zf.read(candidate)
- return ans
+ return ans
\ No newline at end of file
def GetUserHomeAppSupKindleDirParitionName():
home = os.getenv('HOME')
- dpath = home + '/Library/Application Support/Kindle'
+ dpath = home + '/Library'
cmdline = '/sbin/mount'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
# soccer game fan anyone
dpath = home + '/Library/Application Support/Kindle/storage/.pes2011'
# print dpath, os.path.exists(dpath)
+ if os.path.exists(dpath):
+ return True
+ dpath = home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.pes2011'
+ # print dpath, os.path.exists(dpath)
if os.path.exists(dpath):
return True
return False
# Locate the .kindle-info files
def getKindleInfoFiles(kInfoFiles):
- # first search for current .kindle-info files
home = os.getenv('HOME')
- cmdline = 'find "' + home + '/Library/Application Support" -name ".kindle-info"'
+ # search for any .kinf2011 files in new location (Sep 2012)
+ cmdline = 'find "' + home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support" -name ".kinf2011"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
reslst = out1.split('\n')
- kinfopath = 'NONE'
- found = False
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found K4Mac kindle-info file: ' + resline)
+ print('Found k4Mac kinf2011 file: ' + resline)
found = True
- # add any .rainier*-kinf files
- cmdline = 'find "' + home + '/Library/Application Support" -name ".rainier*-kinf"'
+ # search for any .kinf2011 files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".kinf2011"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found k4Mac kinf file: ' + resline)
+ print('Found k4Mac kinf2011 file: ' + resline)
found = True
- # add any .kinf2011 files
- cmdline = 'find "' + home + '/Library/Application Support" -name ".kinf2011"'
+ # search for any .kindle-info files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".kindle-info"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
reslst = out1.split('\n')
+ kinfopath = 'NONE'
+ found = False
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found k4Mac kinf2011 file: ' + resline)
+ print('Found K4Mac kindle-info file: ' + resline)
+ found = True
+ # search for any .rainier*-kinf files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".rainier*-kinf"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
+ p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
+ out1, out2 = p1.communicate()
+ reslst = out1.split('\n')
+ for resline in reslst:
+ if os.path.isfile(resline):
+ kInfoFiles.append(resline)
+ print('Found k4Mac kinf file: ' + resline)
found = True
if not found:
print('No k4Mac kindle-info/kinf/kinf2011 files have been found.')
\b \cf0 Installation
\b0 \
-Drag the DeDRM application from from tools_vX.X\\DeDRM_Applications\\Macintosh (the location of this ReadMe) to your Applications folder, or anywhere else you find convenient.\
+Drag the DeDRM application from from tools_v5.3\\DeDRM_Applications\\Macintosh (the location of this ReadMe) to your Applications folder, or anywhere else you find convenient.\
\
\
\
\b Troubleshooting\
+\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
-\b0 A log is created on your desktop containing detailed information from all the scripts. If you have any problems decrypting your ebooks, quote the contents of this log in a comment at Apprentice Alf's blog.}
\ No newline at end of file
+\b0 \cf0 A log is created on your desktop containing detailed information from all the scripts. If you have any problems decrypting your ebooks, quote the contents of this log in a comment at Apprentice Alf's blog.}
\ No newline at end of file
<key>CFBundleExecutable</key>
<string>droplet</string>
<key>CFBundleGetInfoString</key>
- <string>DeDRM 5.2, Written 2010–2012 by Apprentice Alf and others.</string>
+ <string>DeDRM 5.3, Written 2010–2012 by Apprentice Alf and others.</string>
<key>CFBundleIconFile</key>
<string>DeDRM</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>DeDRM 5.2</string>
+ <string>DeDRM 5.3</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>5.2</string>
+ <string>5.3</string>
<key>CFBundleSignature</key>
<string>dplt</string>
<key>LSMinimumSystemVersion</key>
def GetUserHomeAppSupKindleDirParitionName():
home = os.getenv('HOME')
- dpath = home + '/Library/Application Support/Kindle'
+ dpath = home + '/Library'
cmdline = '/sbin/mount'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
# soccer game fan anyone
dpath = home + '/Library/Application Support/Kindle/storage/.pes2011'
# print dpath, os.path.exists(dpath)
+ if os.path.exists(dpath):
+ return True
+ dpath = home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.pes2011'
+ # print dpath, os.path.exists(dpath)
if os.path.exists(dpath):
return True
return False
# Locate the .kindle-info files
def getKindleInfoFiles(kInfoFiles):
- # first search for current .kindle-info files
home = os.getenv('HOME')
- cmdline = 'find "' + home + '/Library/Application Support" -name ".kindle-info"'
+ # search for any .kinf2011 files in new location (Sep 2012)
+ cmdline = 'find "' + home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support" -name ".kinf2011"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
reslst = out1.split('\n')
- kinfopath = 'NONE'
- found = False
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found K4Mac kindle-info file: ' + resline)
+ print('Found k4Mac kinf2011 file: ' + resline)
found = True
- # add any .rainier*-kinf files
- cmdline = 'find "' + home + '/Library/Application Support" -name ".rainier*-kinf"'
+ # search for any .kinf2011 files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".kinf2011"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found k4Mac kinf file: ' + resline)
+ print('Found k4Mac kinf2011 file: ' + resline)
found = True
- # add any .kinf2011 files
- cmdline = 'find "' + home + '/Library/Application Support" -name ".kinf2011"'
+ # search for any .kindle-info files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".kindle-info"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
reslst = out1.split('\n')
+ kinfopath = 'NONE'
+ found = False
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found k4Mac kinf2011 file: ' + resline)
+ print('Found K4Mac kindle-info file: ' + resline)
+ found = True
+ # search for any .rainier*-kinf files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".rainier*-kinf"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
+ p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
+ out1, out2 = p1.communicate()
+ reslst = out1.split('\n')
+ for resline in reslst:
+ if os.path.isfile(resline):
+ kInfoFiles.append(resline)
+ print('Found k4Mac kinf file: ' + resline)
found = True
if not found:
print('No k4Mac kindle-info/kinf/kinf2011 files have been found.')
-ReadMe_DeDRM_v5.2_WinApp
+ReadMe_DeDRM_v5.3_WinApp
-----------------------
-DeDRM_v5.2_WinApp is a pure python drag and drop application that allows users to drag and drop ebooks or folders of ebooks onto the DeDRM_Drop_Target to have the DRM removed. It repackages the"tools" python software in one easy to use program that remembers preferences and settings.
+DeDRM_v5.3_WinApp is a pure python drag and drop application that allows users to drag and drop ebooks or folders of ebooks onto the DeDRM_Drop_Target to have the DRM removed. It repackages the"tools" python software in one easy to use program that remembers preferences and settings.
It should work out of the box with Kindle for PC ebooks and Adobe Adept epub and pdf ebooks.
Installation
------------
-1. In tools_v5.2\DeDRM_Applications\Windows, right click on DeDRM_5.2_Win.zip and fully extract its contents using "Extract All...", saving to your "My Documents" folder.
+1. In tools_v5.3\DeDRM_Applications\Windows, right click on DeDRM_5.3_Win.zip and fully extract its contents using "Extract All...", saving to your "My Documents" folder.
-2. Open the DeDRM_5.2_Win folder you've just created, and make a short-cut of the DeDRM_Drop_Target.bat file (right-click/Create Shortcut). Drag the shortcut file onto your Desktop.
+2. Open the DeDRM_5.3_Win folder you've just created, and make a short-cut of the DeDRM_Drop_Target.bat file (right-click/Create Shortcut). Drag the shortcut file onto your Desktop.
3. To set the preferences simply double-click on your just created short-cut.
def GetUserHomeAppSupKindleDirParitionName():
home = os.getenv('HOME')
- dpath = home + '/Library/Application Support/Kindle'
+ dpath = home + '/Library'
cmdline = '/sbin/mount'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
# soccer game fan anyone
dpath = home + '/Library/Application Support/Kindle/storage/.pes2011'
# print dpath, os.path.exists(dpath)
+ if os.path.exists(dpath):
+ return True
+ dpath = home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.pes2011'
+ # print dpath, os.path.exists(dpath)
if os.path.exists(dpath):
return True
return False
# Locate the .kindle-info files
def getKindleInfoFiles(kInfoFiles):
- # first search for current .kindle-info files
home = os.getenv('HOME')
- cmdline = 'find "' + home + '/Library/Application Support" -name ".kindle-info"'
+ # search for any .kinf2011 files in new location (Sep 2012)
+ cmdline = 'find "' + home + '/Library/Containers/com.amazon.Kindle/Data/Library/Application Support" -name ".kinf2011"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
reslst = out1.split('\n')
- kinfopath = 'NONE'
- found = False
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found K4Mac kindle-info file: ' + resline)
+ print('Found k4Mac kinf2011 file: ' + resline)
found = True
- # add any .rainier*-kinf files
- cmdline = 'find "' + home + '/Library/Application Support" -name ".rainier*-kinf"'
+ # search for any .kinf2011 files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".kinf2011"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found k4Mac kinf file: ' + resline)
+ print('Found k4Mac kinf2011 file: ' + resline)
found = True
- # add any .kinf2011 files
- cmdline = 'find "' + home + '/Library/Application Support" -name ".kinf2011"'
+ # search for any .kindle-info files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".kindle-info"'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
out1, out2 = p1.communicate()
reslst = out1.split('\n')
+ kinfopath = 'NONE'
+ found = False
for resline in reslst:
if os.path.isfile(resline):
kInfoFiles.append(resline)
- print('Found k4Mac kinf2011 file: ' + resline)
+ print('Found K4Mac kindle-info file: ' + resline)
+ found = True
+ # search for any .rainier*-kinf files
+ cmdline = 'find "' + home + '/Library/Application Support" -name ".rainier*-kinf"'
+ cmdline = cmdline.encode(sys.getfilesystemencoding())
+ p1 = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
+ out1, out2 = p1.communicate()
+ reslst = out1.split('\n')
+ for resline in reslst:
+ if os.path.isfile(resline):
+ kInfoFiles.append(resline)
+ print('Found k4Mac kinf file: ' + resline)
found = True
if not found:
print('No k4Mac kindle-info/kinf/kinf2011 files have been found.')
Welcome to the tools!
=====================
-This ReadMe_First.txt is meant to give users a quick overview of what is available and how to get started. This document is part of the Tools v5.2 archive.
+This ReadMe_First.txt is meant to give users a quick overview of what is available and how to get started. This document is part of the Tools v5.3 archive.
The is archive includes tools to remove DRM from:
DeDRM application for Mac OS X users: (Mac OS X 10.5 and above)
----------------------------------------------------------------------
-Drag the "DeDRM 5.2.app" application from the DeDRM_Applications/Macintosh folder to your Desktop (or your Applications Folder, or anywhere else you find convenient). Double-click on the application to run it and it will guide you through collecting the data it needs to remove the DRM from any of the kinds of DRMed ebook listed in the first section of this ReadMe.
+Drag the "DeDRM 5.3.app" application from the DeDRM_Applications/Macintosh folder to your Desktop (or your Applications Folder, or anywhere else you find convenient). Double-click on the application to run it and it will guide you through collecting the data it needs to remove the DRM from any of the kinds of DRMed ebook listed in the first section of this ReadMe.
To use the DeDRM application, simply drag ebooks, or folders containing ebooks, onto the DeDRM application and it will remove the DRM of the kinds listed above.
***This program requires that Python and PyCrypto be properly installed.***
***See below for details on recommended versions are where to get them.***
-Unzip the DeDRM_5.2_Win.zip archive that's in the DeDRM_Applications/Windows folder, saving the resulting DeDRM_5.2_Win folder in your "My Documents" folder (or anywhere else you find convenient). Make a short-cut on your Desktop of the DeDRM_Drop_Target.bat file that's in the DeDRM_5.2_Win folder. Double-click on the shortcut and the DeDRM application will run and guide you through collecting the data it needs to remove the DRM from any of the kinds of DRMed ebook listed in the first section of this ReadMe.
+Unzip the DeDRM_5.3_Win.zip archive that's in the DeDRM_Applications/Windows folder, saving the resulting DeDRM_5.3_Win folder in your "My Documents" folder (or anywhere else you find convenient). Make a short-cut on your Desktop of the DeDRM_Drop_Target.bat file that's in the DeDRM_5.3_Win folder. Double-click on the shortcut and the DeDRM application will run and guide you through collecting the data it needs to remove the DRM from any of the kinds of DRMed ebook listed in the first section of this ReadMe.
To use the DeDRM application, simply drag ebooks, or folders containing ebooks, onto the DeDRM_Drop_Target.bat shortcut and it will remove the DRM of the kinds listed above.