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: