@@ -511,10 +511,10 @@ def ePubDecrypt(self,path_to_ebook):
511
511
continue
512
512
513
513
# Found matching key
514
- userkey = codecs .decode (userkeyhex , 'hex' )
515
514
print ("{0} v{1}: Trying UUID-matched encryption key {2:s}" .format (PLUGIN_NAME , PLUGIN_VERSION , keyname ))
516
515
of = self .temporary_file (".epub" )
517
516
try :
517
+ userkey = codecs .decode (userkeyhex , 'hex' )
518
518
result = ineptepub .decryptBook (userkey , inf .name , of .name )
519
519
of .close ()
520
520
if result == 0 :
@@ -531,12 +531,13 @@ def ePubDecrypt(self,path_to_ebook):
531
531
532
532
# Attempt to decrypt epub with each encryption key (generated or provided).
533
533
for keyname , userkeyhex in dedrmprefs ['adeptkeys' ].items ():
534
- userkey = codecs . decode ( userkeyhex , 'hex' )
534
+
535
535
print ("{0} v{1}: Trying Encryption key {2:s}" .format (PLUGIN_NAME , PLUGIN_VERSION , keyname ))
536
536
of = self .temporary_file (".epub" )
537
537
538
538
# Give the user key, ebook and TemporaryPersistent file to the decryption function.
539
539
try :
540
+ userkey = codecs .decode (userkeyhex , 'hex' )
540
541
result = ineptepub .decryptBook (userkey , inf .name , of .name )
541
542
except ineptepub .ADEPTNewVersionError :
542
543
print ("{0} v{1}: Book uses unsupported (too new) Adobe DRM." .format (PLUGIN_NAME , PLUGIN_VERSION , time .time ()- self .starttime ))
@@ -673,11 +674,11 @@ def PDFIneptDecrypt(self, path_to_ebook):
673
674
continue
674
675
675
676
# Found matching key
676
- userkey = codecs .decode (userkeyhex , 'hex' )
677
677
print ("{0} v{1}: Trying UUID-matched encryption key {2:s}" .format (PLUGIN_NAME , PLUGIN_VERSION , keyname ))
678
678
of = self .temporary_file (".pdf" )
679
679
680
680
try :
681
+ userkey = codecs .decode (userkeyhex , 'hex' )
681
682
result = ineptpdf .decryptBook (userkey , path_to_ebook , of .name )
682
683
of .close ()
683
684
if result == 0 :
0 commit comments