diff options
author | Apprentice Harper <[email protected]> | 2016-08-10 06:40:48 +0100 |
---|---|---|
committer | Apprentice Harper <[email protected]> | 2016-08-10 06:40:48 +0100 |
commit | c2615c4d3b178addf8f222e6e9eecb004bf06bec (patch) | |
tree | 60e4be750ccba03a3cc0e94b230a547ebc33dca6 /DeDRM_Windows_Application | |
parent | 908ebc5c58a1f346a2e44328c874b1fd26a86319 (diff) |
Change to ineptpdf.py, so that we throw an exception for DRM-free PDFs, rather than processing them.
Diffstat (limited to 'DeDRM_Windows_Application')
3 files changed, 12 insertions, 8 deletions
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 5058476..e9d7165 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_App.pyw +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/DeDRM_App.pyw @@ -26,8 +26,9 @@ # 6.4.2 - Fix for new tags in Topaz ebooks, and very small Topaz ebooks # 6.4.3 - Version bump to match plugin & Mac app # 6.5.0 - Fix for some new tags in Topaz ebooks +# 6.5.1 - Version bump to match plugin & Mac app -__version__ = '6.5.0' +__version__ = '6.5.1' 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 dd3da88..d15eddb 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/__init__.py @@ -54,6 +54,7 @@ __docformat__ = 'restructuredtext en' # 6.5.0 - Big update to Macintosh app # Fix for some more 'new' tags in Topaz ebooks. # Fix an error in wineutils.py +# 6.5.1 - Updated version number, added PDF check for DRM-free documents """ @@ -61,7 +62,7 @@ Decrypt DRMed ebooks. """ PLUGIN_NAME = u"DeDRM" -PLUGIN_VERSION_TUPLE = (6, 5, 0) +PLUGIN_VERSION_TUPLE = (6, 5, 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' 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 0e25d29..6de8671 100644 --- a/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptpdf.py +++ b/DeDRM_Windows_Application/DeDRM_App/DeDRM_lib/lib/ineptpdf.py @@ -57,6 +57,7 @@ from __future__ import with_statement # 8.0.2 - Add additional check on DER file sanity # 8.0.3 - Remove erroneous check on DER file sanity # 8.0.4 - Completely remove erroneous check on DER file sanity +# 8.0.5 - Do not process DRM-free documents """ @@ -64,7 +65,7 @@ Decrypts Adobe ADEPT-encrypted PDF files. """ __license__ = 'GPL v3' -__version__ = "8.0.4" +__version__ = "8.0.5" import sys import os @@ -1468,6 +1469,7 @@ class PDFDocument(object): if not self.encryption: self.is_printable = self.is_modifiable = self.is_extractable = True self.ready = True + raise PDFEncryptionError('Document is not encrypted.') return (docid, param) = self.encryption type = literal_name(param['Filter']) @@ -2180,11 +2182,11 @@ def decryptBook(userkey, inpath, outpath): if RSA is None: raise ADEPTError(u"PyCrypto or OpenSSL must be installed.") with open(inpath, 'rb') as inf: - try: - serializer = PDFSerializer(inf, userkey) - except: - print u"Error serializing pdf {0}. Probably wrong key.".format(os.path.basename(inpath)) - return 2 + #try: + serializer = PDFSerializer(inf, userkey) + #except: + # print u"Error serializing pdf {0}. Probably wrong key.".format(os.path.basename(inpath)) + # return 2 # hope this will fix the 'bad file descriptor' problem with open(outpath, 'wb') as outf: # help construct to make sure the method runs to the end |