Update readme
Begin logging Account for fb2 books without covers
This commit is contained in:
		| @@ -17,9 +17,12 @@ | ||||
| import os | ||||
| import base64 | ||||
| import zipfile | ||||
| import logging | ||||
|  | ||||
| from bs4 import BeautifulSoup | ||||
|  | ||||
| logger = logging.getLogger(__name__) | ||||
|  | ||||
|  | ||||
| class FB2: | ||||
|     def __init__(self, filename): | ||||
| @@ -83,7 +86,9 @@ class FB2: | ||||
|             for i in cover_image_data: | ||||
|                 if cover_image_name.endswith(i.get('id')): | ||||
|                     self.book['cover'] = base64.decodebytes(i.text.encode()) | ||||
|         except AttributeError: | ||||
|         except (AttributeError, TypeError): | ||||
|             # Catch TypeError in case no images exist in the book | ||||
|             logger.error('No cover found for: ' + self.filename) | ||||
|             self.book['cover'] = None | ||||
|  | ||||
|     def parse_chapters(self, temp_dir): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user