diff --git a/CHANGELOG.md b/CHANGELOG.md index 6730270..6eb19cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## Fixed +- Fix issue with ePub rendering which was outside the iframe + ### Changed -- Using zimscraperlib 2.1 +- Using zimscraperlib 3.1.0 - Updated image to `python:3.11-bullseye` -- Retrying video reencoding up to three times +- Retry video reencoding up to three times +- Move inline javascript to dedicated files +- Move huge inline CSS to dedicated file +- Add `--node-ids` CLI parameter to process only few nodes (useful for debugging) ## [1.0.1] - 2023-02-22 diff --git a/kolibri2zim/scraper.py b/kolibri2zim/scraper.py index 287d73e..28d59c1 100644 --- a/kolibri2zim/scraper.py +++ b/kolibri2zim/scraper.py @@ -756,6 +756,9 @@ def run(self): f" tags: {';'.join(self.tags)}" ) + logger.info("Retrieving favicon") + self.retrieve_favicon() + logger.info("Setup Zim Creator") self.output_dir.mkdir(parents=True, exist_ok=True) @@ -764,15 +767,18 @@ def run(self): filename=self.output_dir.joinpath(self.fname), main_path=self.root_id, ignore_duplicates=True, - language="eng", - title=self.title, - description=self.description, - creator=self.author, - publisher=self.publisher, - name=self.name, - tags=";".join(self.tags), - date=datetime.date.today().strftime("%Y-%d-%m"), - ).start() + ) + self.creator.config_metadata( + Name=self.name, + Language="eng", + Title=self.title, + Description=self.description, + Creator=self.author, + Publisher=self.publisher, + Date=datetime.date.today().strftime("%Y-%d-%m"), + Illustration_48x48_at_1=self.favicon_fpath.read_bytes(), + ) + self.creator.start() succeeded = False try: @@ -901,7 +907,7 @@ def sanitize_inputs(self): self.tags = list(set(self.tags + ["_category:other", "kolibri", "_videos:yes"])) - def add_favicon(self): + def retrieve_favicon(self): favicon_orig = self.build_dir / "favicon" # if user provided a custom favicon, retrieve that if self.favicon: @@ -944,8 +950,12 @@ def add_favicon(self): favicon_ico_path = favicon_fpath.with_suffix(".ico") create_favicon(src=favicon_fpath, dst=favicon_ico_path) - self.creator.add_item_for("favicon.png", fpath=favicon_fpath) - self.creator.add_item_for("favicon.ico", fpath=favicon_ico_path) + self.favicon_fpath = favicon_fpath + self.favicon_ico_path = favicon_ico_path + + def add_favicon(self): + self.creator.add_item_for("favicon.png", fpath=self.favicon_fpath) + self.creator.add_item_for("favicon.ico", fpath=self.favicon_ico_path) def add_custom_about_and_css(self): channel_meta = self.db.get_channel_metadata(self.channel_id) diff --git a/requirements.txt b/requirements.txt index 4e1719f..fe0d483 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ -zimscraperlib>=2.1.0,<2.2 -kiwixstorage>=0.8.3,<0.9 -jinja2>=3.1.2<3.2 +## Direct dependencies +zimscraperlib==3.1.0 +kiwixstorage==0.8.3 +Jinja2==3.1.2 pif==0.8.2 -beautifulsoup4>=4.9.0,<5.0 -retrying>=1.3.4,<1.4 +beautifulsoup4==4.9.3 +retrying==1.3.4