mirror of
https://github.com/JockeTF/fimfarchive.git
synced 2024-11-27 23:47:59 +01:00
Add image bundler to fetch command
This commit is contained in:
parent
f8a1820691
commit
b39c916da3
1 changed files with 6 additions and 2 deletions
|
@ -24,7 +24,9 @@ Fetch task.
|
|||
|
||||
from typing import Iterable
|
||||
|
||||
from fimfarchive.converters import FpubEpubConverter, JsonFpubConverter
|
||||
from fimfarchive.converters import (
|
||||
FpubEpubConverter, JsonFpubConverter, WebLocalConverter
|
||||
)
|
||||
from fimfarchive.fetchers import Fetcher
|
||||
from fimfarchive.writers import Writer
|
||||
from fimfarchive.signals import Signal, SignalSender
|
||||
|
@ -62,6 +64,7 @@ class FetchTask(SignalSender):
|
|||
self.writer = writer
|
||||
self.to_fpub = JsonFpubConverter()
|
||||
self.to_epub = FpubEpubConverter()
|
||||
self.to_imgl = WebLocalConverter()
|
||||
self.keys = sorted(set(keys))
|
||||
|
||||
def run(self) -> None:
|
||||
|
@ -74,7 +77,8 @@ class FetchTask(SignalSender):
|
|||
try:
|
||||
json = self.fetcher.fetch(key)
|
||||
fpub = self.to_fpub(json)
|
||||
epub = self.to_epub(fpub)
|
||||
ipub = self.to_imgl(fpub)
|
||||
epub = self.to_epub(ipub)
|
||||
self.writer.write(epub)
|
||||
self.on_success(key, epub)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Reference in a new issue