Fix converter using

This commit is contained in:
2022-01-09 00:06:43 +03:00
parent 2a31f27f44
commit 5136994dd3

View File

@@ -17,6 +17,10 @@ class ReceivedHTML(Exception):
pass pass
class ConvertationError(Exception):
pass
class FLDownloader(BaseDownloader): class FLDownloader(BaseDownloader):
def __init__(self, book_id: int, file_type: str, source_id: int): def __init__(self, book_id: int, file_type: str, source_id: int):
self.book_id = book_id self.book_id = book_id
@@ -98,7 +102,7 @@ class FLDownloader(BaseDownloader):
p_task.cancel() p_task.cancel()
return data return data
except (NotSuccess, ReceivedHTML): except (NotSuccess, ReceivedHTML, ConvertationError):
continue continue
tasks_ = pending tasks_ = pending
@@ -133,7 +137,7 @@ class FLDownloader(BaseDownloader):
) )
if response.status_code != 200: if response.status_code != 200:
raise ValueError raise ConvertationError
return content, False return content, False