diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Info.plist b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Info.plist index e2d40779..9a030d4a 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Info.plist +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Info.plist @@ -24,19 +24,19 @@ CFBundleExecutable droplet CFBundleGetInfoString - DeDRM AppleScript 6.0.5. Written 2010–2013 by Apprentice Alf and others. + DeDRM AppleScript 6.0.7. Written 2010–2013 by Apprentice Alf and others. CFBundleIconFile DeDRM CFBundleIdentifier com.apple.ScriptEditor.id.707CCCD5-0C6C-4BEB-B67C-B6E866ADE85A CFBundleInfoDictionaryVersion - 6.0 + 6.0.7 CFBundleName DeDRM CFBundlePackageType APPL CFBundleShortVersionString - 6.0.5 + 6.0.7 CFBundleSignature dplt LSRequiresCarbon diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/__init__.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/__init__.py index 35c37d7b..caed6e81 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/__init__.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/__init__.py @@ -27,14 +27,18 @@ # Revision history: # 6.0.0 - Initial release # 6.0.1 - Bug Fixes for Windows App, Kindle for Mac and Windows Adobe Digital Editions -# 6.0.2 - Restored call to Wine to get Kindle for PC keys +# 6.0.2 - Restored call to Wine to get Kindle for PC keys, added for ADE +# 6.0.3 - Fixes for Kindle for Mac and Windows non-ascii user names +# 6.0.4 - Fixes for stand-alone scripts and applications +# and pdb files in plugin and initial conversion of prefs. +# 6.0.6 - Fix up an incorrect function call """ Decrypt DRMed ebooks. """ PLUGIN_NAME = u"DeDRM" -PLUGIN_VERSION_TUPLE = (6, 0, 5) +PLUGIN_VERSION_TUPLE = (6, 0, 7) PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE]) # Include an html helpfile in the plugin's zipfile with the following name. RESOURCE_NAME = PLUGIN_NAME + '_Help.htm' @@ -213,10 +217,10 @@ def ePubDecrypt(self,path_to_ebook): else: # linux from wineutils import WineGetKeys - scriptpath = os.join(self.alfdir,u"adobekey.py") + scriptpath = os.path.join(self.alfdir,u"adobekey.py") defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix']) - self.default_key = default_keys[0] + self.default_key = defaultkeys[0] except: traceback.print_exc() self.default_key = u"" @@ -308,7 +312,7 @@ def PDFDecrypt(self,path_to_ebook): try: from wineutils import WineGetKeys - scriptpath = os.join(self.alfdir,u"adobekey.py") + scriptpath = os.path.join(self.alfdir,u"adobekey.py") defaultkeys = self.WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix']) except: pass @@ -386,7 +390,7 @@ def KindleMobiDecrypt(self,path_to_ebook): else: # linux from wineutils import WineGetKeys - scriptpath = os.join(self.alfdir,u"kindlekey.py") + scriptpath = os.path.join(self.alfdir,u"kindlekey.py") defaultkeys = self.WineGetKeys(scriptpath, u".k4i",dedrmprefs['kindlewineprefix']) except: pass @@ -426,7 +430,7 @@ def eReaderDecrypt(self,path_to_ebook): import calibre_plugins.dedrm.prefs as prefs import calibre_plugins.dedrm.erdr2pml - dedrmrefs = prefs.DeDRM_Prefs() + dedrmprefs = prefs.DeDRM_Prefs() # Attempt to decrypt epub with each encryption key (generated or provided). for keyname, userkey in dedrmprefs['ereaderkeys'].items(): keyname_masked = u"".join((u'X' if (x.isdigit()) else x) for x in keyname) diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py index 225ffa74..f8181cb3 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py @@ -3,7 +3,7 @@ from __future__ import with_statement -# ineptepub.pyw, version 5.9 +# ineptepub.pyw, version 6.1 # Copyright © 2009-2010 by i♥cabbages # Released under the terms of the GNU General Public Licence, version 3 diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptpdf.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptpdf.py index 797db602..1986e202 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptpdf.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptpdf.py @@ -51,14 +51,15 @@ # 7.12 - Revised to allow use in calibre plugins to eliminate need for duplicate code # 7.13 - Fixed erroneous mentions of ineptepub # 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility -# 8.0 - Work if TkInter is missing +# 8.0 - Work if TkInter is missing +# 8.0.1 - Broken Metadata fix. """ Decrypts Adobe ADEPT-encrypted PDF files. """ __license__ = 'GPL v3' -__version__ = "8.0" +__version__ = "8.0.1" import sys import os @@ -949,8 +950,11 @@ def nextobject(self, direct=False): try: (pos, objs) = self.end_type('d') if len(objs) % 2 != 0: - raise PSSyntaxError( - 'Invalid dictionary construct: %r' % objs) + print "Incomplete dictionary construct" + objs.append("") # this isn't necessary. + # temporary fix. is this due to rental books? + # raise PSSyntaxError( + # 'Invalid dictionary construct: %r' % objs) d = dict((literal_name(k), v) \ for (k,v) in choplist(2, objs)) self.push((pos, d)) diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py index 0e426a14..929ce574 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py @@ -188,7 +188,7 @@ def fixup(m): def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()): # handle the obvious cases at the beginning if not os.path.isfile(infile): - raise DRMException (u"Input file does not exist.") + raise DrmException(u"Input file does not exist.") mobi = True magic3 = open(infile,'rb').read(3) diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/prefs.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/prefs.py index 2c8c665f..05065acd 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/prefs.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/prefs.py @@ -114,7 +114,7 @@ def parseeReaderString(keystuff): # Generate eReader user key from name and credit card number. keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:]) keyvalue = getuser_key(name,cc).encode('hex') - userkeysappend([keyname,keyvalue]) + userkeys.append([keyname,keyvalue]) except Exception, e: traceback.print_exc() print e.args[0] @@ -231,21 +231,20 @@ def getConfigFiles(extension, encoding = None): dedrmprefs.addnamedvaluetoprefs('bandnkeys', name, value) addedkeycount = len(dedrmprefs['bandnkeys'])-priorkeycount if addedkeycount > 0: - print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ignoblecount, u"key file" if ignoblecount==1 else u"key files") + print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"key file" if addedkeycount==1 else u"key files") # Make the json write all the prefs to disk dedrmprefs.writeprefs(False) # get any .der files in the config dir priorkeycount = len(dedrmprefs['adeptkeys']) adeptfilekeys = getConfigFiles('.der','hex') - ineptcount = addConfigFiles('.der', 'adeptkeys') for keypair in adeptfilekeys: name = keypair[0] value = keypair[1] dedrmprefs.addnamedvaluetoprefs('adeptkeys', name, value) addedkeycount = len(dedrmprefs['adeptkeys'])-priorkeycount if addedkeycount > 0: - print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ineptcount, u"keyfile" if ineptcount==1 else u"keyfiles") + print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"keyfile" if addedkeycount==1 else u"keyfiles") # Make the json write all the prefs to disk dedrmprefs.writeprefs(False) @@ -280,7 +279,7 @@ def getConfigFiles(extension, encoding = None): if addedserialcount > 0: print u"{0} v{1}: {2:d} {3} imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, addedserialcount, u"serial number" if addedserialcount==1 else u"serial numbers") try: - if kindleprefs['wineprefix'] != "": + if 'wineprefix' in kindleprefs and kindleprefs['wineprefix'] != "": dedrmprefs.set('adobewineprefix',kindleprefs['wineprefix']) dedrmprefs.set('kindlewineprefix',kindleprefs['wineprefix']) print u"{0} v{1}: WINEPREFIX ‘(2)’ imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, kindleprefs['wineprefix']) diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/topazextract.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/topazextract.py index 72f8797f..97f65830 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/topazextract.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/topazextract.py @@ -71,7 +71,7 @@ def unicode_argv(): argvencoding = sys.stdin.encoding if argvencoding == None: argvencoding = 'utf-8' - return [arg if (type(arg) == unicode) else unicode(arg, argvencoding) for arg in sys.argv] + return [arg if (type(arg) == unicode) else unicode(arg,argvencoding) for arg in sys.argv] #global switch debug = False @@ -92,12 +92,12 @@ class DrmException(Exception): def zipUpDir(myzip, tdir, localname): currentdir = tdir if localname != u"": - currentdir = os.path.join(currentdir, localname) + currentdir = os.path.join(currentdir,localname) list = os.listdir(currentdir) for file in list: afilename = file localfilePath = os.path.join(localname, afilename) - realfilePath = os.path.join(currentdir, file) + realfilePath = os.path.join(currentdir,file) if os.path.isfile(realfilePath): myzip.write(realfilePath, localfilePath) elif os.path.isdir(realfilePath): @@ -116,7 +116,7 @@ def bookReadEncodedNumber(fo): data = ord(fo.read(1)) if data >= 0x80: datax = (data & 0x7F) - while data >= 0x80: + while data >= 0x80 : data = ord(fo.read(1)) datax = (datax <<7) + (data & 0x7F) data = datax diff --git a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/wineutils.py b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/wineutils.py index f8d5f7ae..b54db804 100644 --- a/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/wineutils.py +++ b/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/wineutils.py @@ -24,7 +24,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""): outdirpath = os.path.join(basepath, u"winekeysdir") if not os.path.exists(outdirpath): - os.mkdir(outdirpath) + os.makedirs(outdirpath) if wineprefix != "" and os.path.exists(wineprefix): cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix) diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_app.pyw b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_app.pyw index 26eb06e5..e73226b7 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_app.pyw +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_app.pyw @@ -12,7 +12,7 @@ # 6.0.4 - Fix for other potential unicode problems # 6.0.5 - Fix typo -__version__ = '6.0.5' +__version__ = '6.0.7' import sys import os, os.path diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py index 830b66df..caed6e81 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py @@ -31,13 +31,14 @@ # 6.0.3 - Fixes for Kindle for Mac and Windows non-ascii user names # 6.0.4 - Fixes for stand-alone scripts and applications # and pdb files in plugin and initial conversion of prefs. +# 6.0.6 - Fix up an incorrect function call """ Decrypt DRMed ebooks. """ PLUGIN_NAME = u"DeDRM" -PLUGIN_VERSION_TUPLE = (6, 0, 5) +PLUGIN_VERSION_TUPLE = (6, 0, 7) PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE]) # Include an html helpfile in the plugin's zipfile with the following name. RESOURCE_NAME = PLUGIN_NAME + '_Help.htm' @@ -216,10 +217,10 @@ def ePubDecrypt(self,path_to_ebook): else: # linux from wineutils import WineGetKeys - scriptpath = os.join(self.alfdir,u"adobekey.py") + scriptpath = os.path.join(self.alfdir,u"adobekey.py") defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix']) - self.default_key = default_keys[0] + self.default_key = defaultkeys[0] except: traceback.print_exc() self.default_key = u"" @@ -311,7 +312,7 @@ def PDFDecrypt(self,path_to_ebook): try: from wineutils import WineGetKeys - scriptpath = os.join(self.alfdir,u"adobekey.py") + scriptpath = os.path.join(self.alfdir,u"adobekey.py") defaultkeys = self.WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix']) except: pass @@ -389,7 +390,7 @@ def KindleMobiDecrypt(self,path_to_ebook): else: # linux from wineutils import WineGetKeys - scriptpath = os.join(self.alfdir,u"kindlekey.py") + scriptpath = os.path.join(self.alfdir,u"kindlekey.py") defaultkeys = self.WineGetKeys(scriptpath, u".k4i",dedrmprefs['kindlewineprefix']) except: pass diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptepub.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptepub.py index 225ffa74..f8181cb3 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptepub.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptepub.py @@ -3,7 +3,7 @@ from __future__ import with_statement -# ineptepub.pyw, version 5.9 +# ineptepub.pyw, version 6.1 # Copyright © 2009-2010 by i♥cabbages # Released under the terms of the GNU General Public Licence, version 3 diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptpdf.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptpdf.py index 797db602..1986e202 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptpdf.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptpdf.py @@ -51,14 +51,15 @@ # 7.12 - Revised to allow use in calibre plugins to eliminate need for duplicate code # 7.13 - Fixed erroneous mentions of ineptepub # 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility -# 8.0 - Work if TkInter is missing +# 8.0 - Work if TkInter is missing +# 8.0.1 - Broken Metadata fix. """ Decrypts Adobe ADEPT-encrypted PDF files. """ __license__ = 'GPL v3' -__version__ = "8.0" +__version__ = "8.0.1" import sys import os @@ -949,8 +950,11 @@ def nextobject(self, direct=False): try: (pos, objs) = self.end_type('d') if len(objs) % 2 != 0: - raise PSSyntaxError( - 'Invalid dictionary construct: %r' % objs) + print "Incomplete dictionary construct" + objs.append("") # this isn't necessary. + # temporary fix. is this due to rental books? + # raise PSSyntaxError( + # 'Invalid dictionary construct: %r' % objs) d = dict((literal_name(k), v) \ for (k,v) in choplist(2, objs)) self.push((pos, d)) diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/k4mobidedrm.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/k4mobidedrm.py index 0e426a14..929ce574 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/k4mobidedrm.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/k4mobidedrm.py @@ -188,7 +188,7 @@ def fixup(m): def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()): # handle the obvious cases at the beginning if not os.path.isfile(infile): - raise DRMException (u"Input file does not exist.") + raise DrmException(u"Input file does not exist.") mobi = True magic3 = open(infile,'rb').read(3) diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/prefs.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/prefs.py index 2c8c665f..05065acd 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/prefs.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/prefs.py @@ -114,7 +114,7 @@ def parseeReaderString(keystuff): # Generate eReader user key from name and credit card number. keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:]) keyvalue = getuser_key(name,cc).encode('hex') - userkeysappend([keyname,keyvalue]) + userkeys.append([keyname,keyvalue]) except Exception, e: traceback.print_exc() print e.args[0] @@ -231,21 +231,20 @@ def getConfigFiles(extension, encoding = None): dedrmprefs.addnamedvaluetoprefs('bandnkeys', name, value) addedkeycount = len(dedrmprefs['bandnkeys'])-priorkeycount if addedkeycount > 0: - print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ignoblecount, u"key file" if ignoblecount==1 else u"key files") + print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"key file" if addedkeycount==1 else u"key files") # Make the json write all the prefs to disk dedrmprefs.writeprefs(False) # get any .der files in the config dir priorkeycount = len(dedrmprefs['adeptkeys']) adeptfilekeys = getConfigFiles('.der','hex') - ineptcount = addConfigFiles('.der', 'adeptkeys') for keypair in adeptfilekeys: name = keypair[0] value = keypair[1] dedrmprefs.addnamedvaluetoprefs('adeptkeys', name, value) addedkeycount = len(dedrmprefs['adeptkeys'])-priorkeycount if addedkeycount > 0: - print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ineptcount, u"keyfile" if ineptcount==1 else u"keyfiles") + print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"keyfile" if addedkeycount==1 else u"keyfiles") # Make the json write all the prefs to disk dedrmprefs.writeprefs(False) @@ -280,7 +279,7 @@ def getConfigFiles(extension, encoding = None): if addedserialcount > 0: print u"{0} v{1}: {2:d} {3} imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, addedserialcount, u"serial number" if addedserialcount==1 else u"serial numbers") try: - if kindleprefs['wineprefix'] != "": + if 'wineprefix' in kindleprefs and kindleprefs['wineprefix'] != "": dedrmprefs.set('adobewineprefix',kindleprefs['wineprefix']) dedrmprefs.set('kindlewineprefix',kindleprefs['wineprefix']) print u"{0} v{1}: WINEPREFIX ‘(2)’ imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, kindleprefs['wineprefix']) diff --git a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/wineutils.py b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/wineutils.py index f8d5f7ae..b54db804 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/wineutils.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/wineutils.py @@ -24,7 +24,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""): outdirpath = os.path.join(basepath, u"winekeysdir") if not os.path.exists(outdirpath): - os.mkdir(outdirpath) + os.makedirs(outdirpath) if wineprefix != "" and os.path.exists(wineprefix): cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix) diff --git a/DeDRM_calibre_plugin/DeDRM_plugin.zip b/DeDRM_calibre_plugin/DeDRM_plugin.zip index 6f6c7a51..7c4878ac 100644 Binary files a/DeDRM_calibre_plugin/DeDRM_plugin.zip and b/DeDRM_calibre_plugin/DeDRM_plugin.zip differ diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py b/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py index 77423e12..caed6e81 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/__init__.py @@ -38,7 +38,7 @@ """ PLUGIN_NAME = u"DeDRM" -PLUGIN_VERSION_TUPLE = (6, 0, 6) +PLUGIN_VERSION_TUPLE = (6, 0, 7) PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE]) # Include an html helpfile in the plugin's zipfile with the following name. RESOURCE_NAME = PLUGIN_NAME + '_Help.htm' @@ -220,7 +220,7 @@ def ePubDecrypt(self,path_to_ebook): scriptpath = os.path.join(self.alfdir,u"adobekey.py") defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix']) - self.default_key = default_keys[0] + self.default_key = defaultkeys[0] except: traceback.print_exc() self.default_key = u"" diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/ignoblekeygen.py b/DeDRM_calibre_plugin/DeDRM_plugin/ignoblekeygen.py index 225ffa74..f8181cb3 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/ignoblekeygen.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/ignoblekeygen.py @@ -3,7 +3,7 @@ from __future__ import with_statement -# ineptepub.pyw, version 5.9 +# ineptepub.pyw, version 6.1 # Copyright © 2009-2010 by i♥cabbages # Released under the terms of the GNU General Public Licence, version 3 diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py b/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py index 797db602..1986e202 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/ineptepub.py @@ -51,14 +51,15 @@ # 7.12 - Revised to allow use in calibre plugins to eliminate need for duplicate code # 7.13 - Fixed erroneous mentions of ineptepub # 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility -# 8.0 - Work if TkInter is missing +# 8.0 - Work if TkInter is missing +# 8.0.1 - Broken Metadata fix. """ Decrypts Adobe ADEPT-encrypted PDF files. """ __license__ = 'GPL v3' -__version__ = "8.0" +__version__ = "8.0.1" import sys import os @@ -949,8 +950,11 @@ def nextobject(self, direct=False): try: (pos, objs) = self.end_type('d') if len(objs) % 2 != 0: - raise PSSyntaxError( - 'Invalid dictionary construct: %r' % objs) + print "Incomplete dictionary construct" + objs.append("") # this isn't necessary. + # temporary fix. is this due to rental books? + # raise PSSyntaxError( + # 'Invalid dictionary construct: %r' % objs) d = dict((literal_name(k), v) \ for (k,v) in choplist(2, objs)) self.push((pos, d)) diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py b/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py index 0e426a14..929ce574 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/ineptpdf.py @@ -188,7 +188,7 @@ def fixup(m): def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()): # handle the obvious cases at the beginning if not os.path.isfile(infile): - raise DRMException (u"Input file does not exist.") + raise DrmException(u"Input file does not exist.") mobi = True magic3 = open(infile,'rb').read(3) diff --git a/DeDRM_calibre_plugin/DeDRM_plugin/zipfix.py b/DeDRM_calibre_plugin/DeDRM_plugin/zipfix.py index f8d5f7ae..b54db804 100644 --- a/DeDRM_calibre_plugin/DeDRM_plugin/zipfix.py +++ b/DeDRM_calibre_plugin/DeDRM_plugin/zipfix.py @@ -24,7 +24,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""): outdirpath = os.path.join(basepath, u"winekeysdir") if not os.path.exists(outdirpath): - os.mkdir(outdirpath) + os.makedirs(outdirpath) if wineprefix != "" and os.path.exists(wineprefix): cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)