mirror of
https://github.com/noDRM/DeDRM_tools.git
synced 2026-03-22 05:48:57 +00:00
Compare commits
5 Commits
71c2ef00e1
...
312f6bd836
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
312f6bd836 | ||
|
|
bf2471e65b | ||
|
|
5492dcdbf4 | ||
|
|
413182b97b | ||
|
|
7e374cee3e |
@@ -2042,7 +2042,7 @@ class PDFParser(PSStackParser):
|
|||||||
except PDFNoValidXRef:
|
except PDFNoValidXRef:
|
||||||
# fallback
|
# fallback
|
||||||
self.seek(0)
|
self.seek(0)
|
||||||
pat = re.compile(rb'^(\\d+)\\s+(\\d+)\\s+obj\\b')
|
pat = re.compile(br'^(\\d+)\\s+(\\d+)\\s+obj\\b')
|
||||||
offsets = {}
|
offsets = {}
|
||||||
xref = PDFXRef()
|
xref = PDFXRef()
|
||||||
while 1:
|
while 1:
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ class KFXZipBook:
|
|||||||
# Belt and braces. PIDs should be unicode strings, but just in case...
|
# Belt and braces. PIDs should be unicode strings, but just in case...
|
||||||
if isinstance(pid, bytes):
|
if isinstance(pid, bytes):
|
||||||
pid = pid.decode('ascii')
|
pid = pid.decode('ascii')
|
||||||
for dsn_len,secret_len in [(0,0), (16,0), (16,40), (32,40), (40,0), (40,40)]:
|
for dsn_len,secret_len in [(0,0), (16,0), (16,40), (32,0), (32,40), (40,0), (40,40)]:
|
||||||
if len(pid) == dsn_len + secret_len:
|
if len(pid) == dsn_len + secret_len:
|
||||||
break # split pid into DSN and account secret
|
break # split pid into DSN and account secret
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -374,7 +374,11 @@ class InterfacePluginAction(InterfaceAction):
|
|||||||
result['success'] = False
|
result['success'] = False
|
||||||
result['fileobj'] = None
|
result['fileobj'] = None
|
||||||
|
|
||||||
zin = zipfile.ZipFile(book.filename, 'r')
|
try:
|
||||||
|
zin = zipfile.ZipFile(book.filename, 'r')
|
||||||
|
except FileNotFoundError:
|
||||||
|
print (_('{0} - File "{1}" not found. Make sure the eBook has been properly downloaded in the Kobo app.').format(PLUGIN_NAME, book.filename))
|
||||||
|
return result
|
||||||
#print ('Kobo library filename: {0}'.format(book.filename))
|
#print ('Kobo library filename: {0}'.format(book.filename))
|
||||||
for userkey in self.userkeys:
|
for userkey in self.userkeys:
|
||||||
print (_('Trying key: '), codecs.encode(userkey, 'hex'))
|
print (_('Trying key: '), codecs.encode(userkey, 'hex'))
|
||||||
|
|||||||
@@ -2643,7 +2643,7 @@ class PDFParser(PSStackParser):
|
|||||||
except PDFNoValidXRef:
|
except PDFNoValidXRef:
|
||||||
# fallback
|
# fallback
|
||||||
self.seek(0)
|
self.seek(0)
|
||||||
pat = re.compile(rb'^(\d+)\s+(\d+)\s+obj\b')
|
pat = re.compile(br'^(\\d+)\\s+(\\d+)\\s+obj\\b')
|
||||||
offsets = {}
|
offsets = {}
|
||||||
xref = PDFXRef()
|
xref = PDFXRef()
|
||||||
while 1:
|
while 1:
|
||||||
|
|||||||
Reference in New Issue
Block a user