Compare commits

...

5 Commits

Author SHA1 Message Date
precondition
312f6bd836 Merge 413182b97b into bf2471e65b 2023-12-22 14:43:44 +09:00
NoDRM
bf2471e65b Update kfxdedrm as suggested in #440 2023-12-21 12:35:11 +01:00
NoDRM
5492dcdbf4 More FileOpen fixes 2023-12-21 11:57:39 +01:00
precondition
413182b97b Obok.py/action.py: invoke _() only once 2023-08-11 17:51:28 +02:00
precondition
7e374cee3e Catch FileNotFoundError due to undownloaded ebooks 2023-08-10 11:09:49 +02:00
4 changed files with 8 additions and 4 deletions

View File

@@ -2042,7 +2042,7 @@ class PDFParser(PSStackParser):
except PDFNoValidXRef:
# fallback
self.seek(0)
pat = re.compile(rb'^(\\d+)\\s+(\\d+)\\s+obj\\b')
pat = re.compile(br'^(\\d+)\\s+(\\d+)\\s+obj\\b')
offsets = {}
xref = PDFXRef()
while 1:

View File

@@ -74,7 +74,7 @@ class KFXZipBook:
# 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)]:
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:
break # split pid into DSN and account secret
else:

View File

@@ -374,7 +374,11 @@ class InterfacePluginAction(InterfaceAction):
result['success'] = False
result['fileobj'] = None
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))
for userkey in self.userkeys:
print (_('Trying key: '), codecs.encode(userkey, 'hex'))

View File

@@ -2643,7 +2643,7 @@ class PDFParser(PSStackParser):
except PDFNoValidXRef:
# fallback
self.seek(0)
pat = re.compile(rb'^(\d+)\s+(\d+)\s+obj\b')
pat = re.compile(br'^(\\d+)\\s+(\\d+)\\s+obj\\b')
offsets = {}
xref = PDFXRef()
while 1: