From 82d6fa923d9a9b04ebad18262b3837b754dd03ef Mon Sep 17 00:00:00 2001 From: Dan Niles <56271899+dan-niles@users.noreply.github.com> Date: Fri, 28 Jun 2024 07:48:45 +0530 Subject: [PATCH] Fix ZIM title in index.html of new Vue.js UI --- scraper/src/youtube2zim/scraper.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/scraper/src/youtube2zim/scraper.py b/scraper/src/youtube2zim/scraper.py index ea768d78..485d2bb6 100644 --- a/scraper/src/youtube2zim/scraper.py +++ b/scraper/src/youtube2zim/scraper.py @@ -428,11 +428,27 @@ def add_zimui(self): continue path = str(Path(file).relative_to(self.zimui_dist)) logger.debug(f"Adding {path} to ZIM") - self.zim_file.add_item_for( - path, - fpath=file, - is_front=path == "index.html", - ) + if path == "index.html": # Change index.html title and add to ZIM + index_html_path = self.zimui_dist / path + html_content = index_html_path.read_text(encoding="utf-8") + new_html_content = re.sub( + r"(