mirror of
https://github.com/flibusta-apps/books_downloader.git
synced 2025-12-06 06:55:37 +01:00
Fix converter using
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user