Skip to content

Commit

Permalink
Catch FileNotFoundError due to undownloaded ebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
precondition authored and noDRM committed Nov 10, 2024
1 parent 05fff52 commit 2e53d70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Obok_plugin/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,11 @@ def decryptBook(self, book):
result['success'] = False
result['fileobj'] = None

zin = zipfile.ZipFile(book.filename, 'r')
try:
zin = zipfile.ZipFile(book.filename, 'r')
except FileNotFoundError:
print(_("File not found. Make sure that the ebook has been properly downloaded in the Kobo app. ("), book.filename, _(")"))
return result
#print ('Kobo library filename: {0}'.format(book.filename))
for userkey in self.userkeys:
print (_('Trying key: '), codecs.encode(userkey, 'hex'))
Expand Down

0 comments on commit 2e53d70

Please sign in to comment.