Update version and FAQs

Version 7.2.0 with all the latest pull requests, including on for the latest KFX encryption.
This commit is contained in:
Apprentice Harper
2021-04-11 15:28:33 +01:00
parent bc1c3c2197
commit 45a1a64db5
6 changed files with 18 additions and 11 deletions

View File

@@ -5,7 +5,7 @@
# Copyright © 2008-2020 Apprentice Harper et al.
__license__ = 'GPL v3'
__version__ = '7.1.0'
__version__ = '7.2.0'
__docformat__ = 'restructuredtext en'
@@ -75,6 +75,7 @@ __docformat__ = 'restructuredtext en'
# 7.0.2 - More Python 3 changes. Adobe PDF decryption should now work on PC too.
# 7.0.3 - More Python 3 changes. Integer division in ineptpdf.py
# 7.1.0 - Full release for calibre 5.x
# 7.2.0 - Update for latest KFX changes, and Python 3 Obok fixes.
"""
Decrypt DRMed ebooks.

View File

@@ -4,10 +4,12 @@
# Engine to remove drm from Kindle KFX ebooks
# 2.0 - Python 3 for calibre 5.0
# 2.1 - Some fixes for debugging
import os
import shutil
import traceback
import zipfile
from io import BytesIO
@@ -65,6 +67,9 @@ class KFXZipBook:
print("Decrypting KFX DRM voucher: {0}".format(info.filename))
for pid in [''] + totalpids:
# Belt and braces. PIDs should be unicode strings, but just in case...
if isinstance(pid, bytes):
pid = pid.decode('ascii')
for dsn_len,secret_len in [(0,0), (16,0), (16,40), (32,40), (40,0), (40,40)]:
if len(pid) == dsn_len + secret_len:
break # split pid into DSN and account secret
@@ -77,7 +82,8 @@ class KFXZipBook:
voucher.decryptvoucher()
break
except:
pass
traceback.print_exc()
pass
else:
raise Exception("Failed to decrypt KFX DRM voucher with any key")