From 1327de576617c0519f5ba6d7a89a2b658722eb5d Mon Sep 17 00:00:00 2001 From: tim Date: Thu, 8 Jun 2017 11:00:26 +0200 Subject: [PATCH] Allow more book types --- process_ebooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/process_ebooks.py b/process_ebooks.py index cf2a199..a91d6f9 100755 --- a/process_ebooks.py +++ b/process_ebooks.py @@ -20,7 +20,7 @@ else: ebook_dir = os.path.expanduser(ebook_dir) for root, dirs, files in os.walk(ebook_dir): for file in files: - if re.search('.(rar|zip|epub|mobi|lit|html)(.\d+)?', file): + if re.search('.(rar|zip|epub|mobi|lit|html|rtf|azw3)(.\d+)?', file): try: if os.path.getmtime(file) >= age: books.append(os.path.join(root, file)) @@ -42,13 +42,13 @@ for book in books: # unzip archive = zipfile.ZipFile(book) archive.extractall(tmp) - elif re.search('.(epub|mobi|lit|html)', book): + elif re.search('.(epub|mobi|lit|html|rtf|awz3)', book): # copy book into tmp shutil.copy(book, tmp) # find epub, mobi or lit and import into calibre for root, dirs, files in os.walk(tmp): for file in files: - if re.search('.(epub|mobi|lit|html)$', file): + if re.search('.(epub|mobi|lit|html|rtf|azw3)$', file): try: subprocess.call(["calibredb", "add", os.path.join(root, file)]) except Exception, e: