summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoDRM <[email protected]>2022-03-19 16:02:33 +0100
committerNoDRM <[email protected]>2022-03-19 16:02:33 +0100
commit7eb8f07a33c28a49452a9755742d535ac8a33ed2 (patch)
tree06397925340945b684ce5c39af1f52d0a24e1e02
parente4fe032e4719e87e004b2f36e433051bf3345b85 (diff)
Bugfix for Nook PDFs?
-rwxr-xr-xDeDRM_plugin/ineptpdf.py7
-rw-r--r--DeDRM_plugin/wineutils.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/DeDRM_plugin/ineptpdf.py b/DeDRM_plugin/ineptpdf.py
index cb179de..310ab1e 100755
--- a/DeDRM_plugin/ineptpdf.py
+++ b/DeDRM_plugin/ineptpdf.py
@@ -1601,7 +1601,12 @@ class PDFDocument(object):
def initialize_ebx_ignoble(self, keyb64, docid, param):
self.is_printable = self.is_modifiable = self.is_extractable = True
- key = keyb64.decode('base64')[:16]
+ try:
+ key = keyb64.decode('base64')[:16]
+ # This will probably always error, but I'm not 100% sure, so lets leave the old code in.
+ except AttributeError:
+ key = codecs.decode(keyb64.encode("ascii"), 'base64')[:16]
+
length = int_value(param.get('Length', 0)) / 8
rights = str_value(param.get('ADEPT_LICENSE')).decode('base64')
rights = zlib.decompress(rights, -15)
diff --git a/DeDRM_plugin/wineutils.py b/DeDRM_plugin/wineutils.py
index cd79b4c..ed4e653 100644
--- a/DeDRM_plugin/wineutils.py
+++ b/DeDRM_plugin/wineutils.py
@@ -77,7 +77,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""):
pyexec = WinePythonCLI(wineprefix)
except NoWinePython3Exception:
print('{0} v{1}: Unable to find python3 executable in WINEPREFIX="{2}"'.format(PLUGIN_NAME, PLUGIN_VERSION, wineprefix))
- return []
+ return [], []
basepath, script = os.path.split(scriptpath)
print("{0} v{1}: Running {2} under Wine".format(PLUGIN_NAME, PLUGIN_VERSION, script))