diff options
Diffstat (limited to 'app/converter/extractors.py')
| -rw-r--r-- | app/converter/extractors.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/converter/extractors.py b/app/converter/extractors.py index a564333..f05d451 100644 --- a/app/converter/extractors.py +++ b/app/converter/extractors.py @@ -79,8 +79,7 @@ def extract_book(file_path: Path) -> Book: def _epub_metadata(file_path: Path) -> tuple: """Return (title, author) from an EPUB's Dublin Core metadata.""" try: - import ebooklib - from ebooklib import epub + from ebooklib import epub # raises ImportError when unavailable book = epub.read_epub(str(file_path)) title = _first_dc_value(book.get_metadata("DC", "title")) @@ -116,8 +115,6 @@ def _first_dc_value(entries) -> str: def _extract_epub_chapters(file_path: Path) -> List[Section]: """Return one Section per EPUB spine document (chapter), in reading order.""" - import ebooklib - book = None for method in (_read_epub_ebooklib, _read_epub_zipfile, _read_epub_manual): try: |
