summaryrefslogtreecommitdiffstats
path: root/DeDRM_plugin/kfxdedrm.py
diff options
context:
space:
mode:
authorxxyzz <[email protected]>2020-11-27 22:01:18 +0800
committerxxyzz <[email protected]>2020-11-27 22:01:18 +0800
commit66bab7bd7d71568fcca9e0c52c79e3e707b3e3eb (patch)
treed07e066404da35db833e94b5ff3949895d5dc0f2 /DeDRM_plugin/kfxdedrm.py
parente0c7d7d382ff668a119b0859988a194003d52d08 (diff)
using byte string in kfxdedrm.py
Diffstat (limited to 'DeDRM_plugin/kfxdedrm.py')
-rw-r--r--DeDRM_plugin/kfxdedrm.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/DeDRM_plugin/kfxdedrm.py b/DeDRM_plugin/kfxdedrm.py
index 5300018..8bacd87 100644
--- a/DeDRM_plugin/kfxdedrm.py
+++ b/DeDRM_plugin/kfxdedrm.py
@@ -35,7 +35,7 @@ class KFXZipBook:
for filename in zf.namelist():
with zf.open(filename) as fh:
data = fh.read(8)
- if data != '\xeaDRMION\xee':
+ if data != b'\xeaDRMION\xee':
continue
data += fh.read()
if self.voucher is None:
@@ -53,11 +53,11 @@ class KFXZipBook:
for info in zf.infolist():
with zf.open(info.filename) as fh:
data = fh.read(4)
- if data != '\xe0\x01\x00\xea':
+ if data != b'\xe0\x01\x00\xea':
continue
data += fh.read()
- if 'ProtectedData' in data:
+ if b'ProtectedData' in data:
break # found DRM voucher
else:
raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")