]> xmof Git - DeDRM.git/commitdiff
Fix DeACSM import for PDF files
authorNoDRM <no_drm123@protonmail.com>
Sun, 7 Aug 2022 07:31:49 +0000 (09:31 +0200)
committerNoDRM <no_drm123@protonmail.com>
Sun, 7 Aug 2022 07:31:49 +0000 (09:31 +0200)
CHANGELOG.md
DeDRM_plugin/__init__.py

index 808ce31bb0ac8c93bb304f5fd613dfb0a76e7fa0..da8525a68a5603a558ebc67ea363a23d28c77a42 100644 (file)
@@ -77,3 +77,4 @@ List of changes since the fork of Apprentice Harper's repository:
 - Small Python 2 / Calibre 4 bugfix for Obok.
 - Removing ancient AlfCrypto machine code libraries, moving all encryption / decryption to Python code.
 - General cleanup and removal of dead code.
+- Fix a bug where ADE account keys weren't automatically imported from the DeACSM plugin when importing a PDF file.
index 13a919021c5a6ae48e9aabcb746d83c0a9f34161..9204600bf5aaf5920250258ca70ef57367c58f49 100644 (file)
@@ -733,10 +733,10 @@ class DeDRM(FileTypePlugin):
             if newkey is not None: 
                 if codecs.encode(newkey, 'hex').decode('ascii') not in dedrmprefs['adeptkeys'].values():
                     print("{0} v{1}: Found new key '{2}' in DeACSM plugin".format(PLUGIN_NAME, PLUGIN_VERSION, newname))
-                    newkeys.append(keyvalue)
+                    newkeys.append(newkey)
                     newnames.append(newname)
         except:
-            pass
+            traceback.print_exc()
 
         if len(newkeys) > 0:
             try:
@@ -770,7 +770,7 @@ class DeDRM(FileTypePlugin):
 
                     print("{0} v{1}: Failed to decrypt with new default key after {2:.1f} seconds".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
             except Exception as e:
-                pass
+                traceback.print_exc()
 
 
         # Unable to decrypt the PDF with any of the existing keys. Is it a B&N PDF?