]> xmof Git - DeDRM.git/commitdiff
Fox for new tags in Topaz format ebooks.
authorApprentice Harper <apprenticeharper@gmail.com>
Wed, 13 Apr 2016 17:39:13 +0000 (18:39 +0100)
committerApprentice Harper <apprenticeharper@gmail.com>
Wed, 13 Apr 2016 17:39:13 +0000 (18:39 +0100)
DeDRM_Macintosh_Application/DeDRM.app/Contents/Info.plist
DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/__init__.py
DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/convert2xml.py
DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/kindlekey.py
DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_App.pyw
DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py
DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/convert2xml.py
DeDRM_calibre_plugin/DeDRM_plugin.zip
DeDRM_calibre_plugin/DeDRM_plugin/__init__.py
DeDRM_calibre_plugin/DeDRM_plugin/convert2xml.py

index 94ad26c39e2bb8624869b6102fb7768f80ac6334..0edfc819c802f081b05bbc121b7f21da86f5170e 100644 (file)
@@ -24,7 +24,7 @@
        <key>CFBundleExecutable</key>
        <string>droplet</string>
        <key>CFBundleGetInfoString</key>
-       <string>DeDRM AppleScript 6.4.0 Written 2010–2016 by Apprentice Alf et al.</string>
+       <string>DeDRM AppleScript 6.4.1 Written 2010–2016 by Apprentice Alf et al.</string>
        <key>CFBundleIconFile</key>
        <string>DeDRM</string>
        <key>CFBundleIdentifier</key>
@@ -36,7 +36,7 @@
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
-       <string>6.4.0</string>
+       <string>6.4.1</string>
        <key>CFBundleSignature</key>
        <string>dplt</string>
        <key>LSRequiresCarbon</key>
index 880d9fe62dd254f4fe4d57fcd7d3bd3b3dcef206..ddba7a421ff4257a08ffa4263dee08fb8bde5aea 100644 (file)
@@ -9,8 +9,6 @@ __docformat__ = 'restructuredtext en'
 # Released under the terms of the GNU General Public Licence, version 3
 # <http://www.gnu.org/licenses/>
 #
-# Requires Calibre version 0.7.55 or higher.
-#
 # All credit given to i♥cabbages and The Dark Reverser for the original standalone scripts.
 # We had the much easier job of converting them to a calibre plugin.
 #
@@ -49,6 +47,7 @@ __docformat__ = 'restructuredtext en'
 #   6.3.5 - Fixes for Linux, and Kobo 3.19 and more logging
 #   6.3.6 - Fixes for ADE ePub and PDF introduced in 6.3.5
 #   6.4.0 - Updated for new Kindle for PC encryption
+#   6.4.1 - Fix for some new tags in Topaz ebooks.
 
 
 """
@@ -56,7 +55,7 @@ Decrypt DRMed ebooks.
 """
 
 PLUGIN_NAME = u"DeDRM"
-PLUGIN_VERSION_TUPLE = (6, 4, 0)
+PLUGIN_VERSION_TUPLE = (6, 4, 1)
 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'
index 101c45ad47b0fd62880e5f44a299b7bf741f5752..bbb7b045239b1e98577fd97cffa4fe3af711e79e 100644 (file)
@@ -164,6 +164,7 @@ class PageParser(object):
         self.id = os.path.basename(filename).replace('.dat','')
         self.dict = dict
         self.debug = debug
+        self.first_unknown = True
         self.flat_xml = flat_xml
         self.tagpath = []
         self.doc = []
@@ -262,6 +263,9 @@ class PageParser(object):
         'img.w'                 : (1, 'scalar_number', 0, 0),
         'img.src'               : (1, 'scalar_number', 0, 0),
         'img.color_src'         : (1, 'scalar_number', 0, 0),
+        'img.gridSize'          : (1, 'scalar_number', 0, 0),
+        'img.gridBottomCenter'  : (1, 'scalar_number', 0, 0),
+        'img.gridTopCenter'     : (1, 'scalar_number', 0, 0),
         'img.gridBeginCenter'   : (1, 'scalar_number', 0, 0),
         'img.gridEndCenter'     : (1, 'scalar_number', 0, 0),
         'img.image_type'        : (1, 'scalar_number', 0, 0),
@@ -506,8 +510,9 @@ class PageParser(object):
         # or an out of sync condition
         else:
             result = []
-            if (self.debug):
+            if (self.debug or self.first_unknown):
                 print 'Unknown Token:', token
+                self.first_unknown = False
             self.tag_pop()
             return result
 
index 0b149882c0a5ce6080108c71a5464d8ec59f24be..c5159ccb9404da64c214681500c895afb78c981f 100644 (file)
@@ -4,7 +4,7 @@
 from __future__ import with_statement
 
 # kindlekey.py
-# Copyright © 2010-2016 by some_updates, Apprentice Alf and Apprentice Harper
+# Copyright © 2010-2015 by some_updates, Apprentice Alf and Apprentice Harper
 
 # Revision history:
 #  1.0   - Kindle info file decryption, extracted from k4mobidedrm, etc.
@@ -19,7 +19,6 @@ from __future__ import with_statement
 #  1.8   - Fixes for Kindle for Mac, and non-ascii in Windows user names
 #  1.9   - Fixes for Unicode in Windows user names
 #  2.0   - Added comments and extra fix for non-ascii Windows user names
-#  2.1   - Fixed Kindle for PC encryption changes March 2016
 
 
 """
@@ -27,7 +26,7 @@ Retrieve Kindle for PC/Mac user key.
 """
 
 __license__ = 'GPL v3'
-__version__ = '2.1'
+__version__ = '1.9'
 
 import sys, os, re
 from struct import pack, unpack, unpack_from
@@ -1813,7 +1812,7 @@ elif isosx:
                 pass
         if len(DB)>4:
             # store values used in decryption
-            print u"Decrypted key file using IDString '{0:s}' and UserName '{1:s}'".format(IDString, GetUserName().encode('hex'))
+            print u"Decrypted key file using IDString '{0:s}' and UserName '{1:s}'".format(IDString, GetUserName())
             DB['IDString'] = IDString
             DB['UserName'] = GetUserName()
         else:
@@ -1875,7 +1874,7 @@ def cli_main():
     sys.stderr=SafeUnbuffered(sys.stderr)
     argv=unicode_argv()
     progname = os.path.basename(argv[0])
-    print u"{0} v{1}\nCopyright © 2010-2016 by some_updates, Apprentice Alf and Apprentice Harper".format(progname,__version__)
+    print u"{0} v{1}\nCopyright © 2010-2013 some_updates and Apprentice Alf".format(progname,__version__)
 
     try:
         opts, args = getopt.getopt(argv[1:], "hk:")
@@ -1905,7 +1904,7 @@ def cli_main():
         # save to the same directory as the script
         outpath = os.path.dirname(argv[0])
 
-    # make sure the outpath is canonical
+    # make sure the outpath is the
     outpath = os.path.realpath(os.path.normpath(outpath))
 
     if not getkey(outpath, files):
index 4eda87f910a2f18254ca5a1fe283c9e2c25c41eb..6a2e6c8919264f485cfb3ad9dd74e9d8e050c4d9 100644 (file)
@@ -22,8 +22,9 @@
 #   6.3.5 - Version bump to match plugin
 #   6.3.6 - Version bump to match plugin
 #   6.4.0 - Fix for Kindle for PC encryption change
+#   6.4.1 - Fix for new tags in Topaz ebooks
 
-__version__ = '6.4.0'
+__version__ = '6.4.1'
 
 import sys
 import os, os.path
index 880d9fe62dd254f4fe4d57fcd7d3bd3b3dcef206..ddba7a421ff4257a08ffa4263dee08fb8bde5aea 100644 (file)
@@ -9,8 +9,6 @@ __docformat__ = 'restructuredtext en'
 # Released under the terms of the GNU General Public Licence, version 3
 # <http://www.gnu.org/licenses/>
 #
-# Requires Calibre version 0.7.55 or higher.
-#
 # All credit given to i♥cabbages and The Dark Reverser for the original standalone scripts.
 # We had the much easier job of converting them to a calibre plugin.
 #
@@ -49,6 +47,7 @@ __docformat__ = 'restructuredtext en'
 #   6.3.5 - Fixes for Linux, and Kobo 3.19 and more logging
 #   6.3.6 - Fixes for ADE ePub and PDF introduced in 6.3.5
 #   6.4.0 - Updated for new Kindle for PC encryption
+#   6.4.1 - Fix for some new tags in Topaz ebooks.
 
 
 """
@@ -56,7 +55,7 @@ Decrypt DRMed ebooks.
 """
 
 PLUGIN_NAME = u"DeDRM"
-PLUGIN_VERSION_TUPLE = (6, 4, 0)
+PLUGIN_VERSION_TUPLE = (6, 4, 1)
 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'
index 101c45ad47b0fd62880e5f44a299b7bf741f5752..bbb7b045239b1e98577fd97cffa4fe3af711e79e 100644 (file)
@@ -164,6 +164,7 @@ class PageParser(object):
         self.id = os.path.basename(filename).replace('.dat','')
         self.dict = dict
         self.debug = debug
+        self.first_unknown = True
         self.flat_xml = flat_xml
         self.tagpath = []
         self.doc = []
@@ -262,6 +263,9 @@ class PageParser(object):
         'img.w'                 : (1, 'scalar_number', 0, 0),
         'img.src'               : (1, 'scalar_number', 0, 0),
         'img.color_src'         : (1, 'scalar_number', 0, 0),
+        'img.gridSize'          : (1, 'scalar_number', 0, 0),
+        'img.gridBottomCenter'  : (1, 'scalar_number', 0, 0),
+        'img.gridTopCenter'     : (1, 'scalar_number', 0, 0),
         'img.gridBeginCenter'   : (1, 'scalar_number', 0, 0),
         'img.gridEndCenter'     : (1, 'scalar_number', 0, 0),
         'img.image_type'        : (1, 'scalar_number', 0, 0),
@@ -506,8 +510,9 @@ class PageParser(object):
         # or an out of sync condition
         else:
             result = []
-            if (self.debug):
+            if (self.debug or self.first_unknown):
                 print 'Unknown Token:', token
+                self.first_unknown = False
             self.tag_pop()
             return result
 
index 5ad702b751320a68e0da2cf0659922b92afc744e..de165c15ff8f3067226172a9a725f02de028edfc 100644 (file)
Binary files a/DeDRM_calibre_plugin/DeDRM_plugin.zip and b/DeDRM_calibre_plugin/DeDRM_plugin.zip differ
index 880d9fe62dd254f4fe4d57fcd7d3bd3b3dcef206..ddba7a421ff4257a08ffa4263dee08fb8bde5aea 100644 (file)
@@ -9,8 +9,6 @@ __docformat__ = 'restructuredtext en'
 # Released under the terms of the GNU General Public Licence, version 3
 # <http://www.gnu.org/licenses/>
 #
-# Requires Calibre version 0.7.55 or higher.
-#
 # All credit given to i♥cabbages and The Dark Reverser for the original standalone scripts.
 # We had the much easier job of converting them to a calibre plugin.
 #
@@ -49,6 +47,7 @@ __docformat__ = 'restructuredtext en'
 #   6.3.5 - Fixes for Linux, and Kobo 3.19 and more logging
 #   6.3.6 - Fixes for ADE ePub and PDF introduced in 6.3.5
 #   6.4.0 - Updated for new Kindle for PC encryption
+#   6.4.1 - Fix for some new tags in Topaz ebooks.
 
 
 """
@@ -56,7 +55,7 @@ Decrypt DRMed ebooks.
 """
 
 PLUGIN_NAME = u"DeDRM"
-PLUGIN_VERSION_TUPLE = (6, 4, 0)
+PLUGIN_VERSION_TUPLE = (6, 4, 1)
 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'
index 101c45ad47b0fd62880e5f44a299b7bf741f5752..bbb7b045239b1e98577fd97cffa4fe3af711e79e 100644 (file)
@@ -164,6 +164,7 @@ class PageParser(object):
         self.id = os.path.basename(filename).replace('.dat','')
         self.dict = dict
         self.debug = debug
+        self.first_unknown = True
         self.flat_xml = flat_xml
         self.tagpath = []
         self.doc = []
@@ -262,6 +263,9 @@ class PageParser(object):
         'img.w'                 : (1, 'scalar_number', 0, 0),
         'img.src'               : (1, 'scalar_number', 0, 0),
         'img.color_src'         : (1, 'scalar_number', 0, 0),
+        'img.gridSize'          : (1, 'scalar_number', 0, 0),
+        'img.gridBottomCenter'  : (1, 'scalar_number', 0, 0),
+        'img.gridTopCenter'     : (1, 'scalar_number', 0, 0),
         'img.gridBeginCenter'   : (1, 'scalar_number', 0, 0),
         'img.gridEndCenter'     : (1, 'scalar_number', 0, 0),
         'img.image_type'        : (1, 'scalar_number', 0, 0),
@@ -506,8 +510,9 @@ class PageParser(object):
         # or an out of sync condition
         else:
             result = []
-            if (self.debug):
+            if (self.debug or self.first_unknown):
                 print 'Unknown Token:', token
+                self.first_unknown = False
             self.tag_pop()
             return result