From bc1c097271f4e954261e4f3294283dfc601c7503 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Mon, 8 Jul 2024 12:34:10 +0200 Subject: [PATCH] Updated readme for setup calibre binaries Added h tags to recognized tags for sanitizing comments Avoid depreciation warning in lubimyczytac Removed some unsed imports --- README.md | 4 ++-- cps/clean_html.py | 2 +- cps/editbooks.py | 2 +- cps/file_helper.py | 1 - cps/metadata_provider/lubimyczytac.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 52fa6a0c..2d6efaf5 100755 --- a/README.md +++ b/README.md @@ -107,8 +107,8 @@ Pre-built Docker images are available in the following Docker Hub repositories ( Both the Calibre-Web and Calibre-Mod images are automatically rebuilt on new releases and updates. - - Set "path to convertertool" to `/usr/bin/ebook-convert` - - Set "path to unrar" to `/usr/bin/unrar` + - Set "Path to Calibre Binaries" to `/usr/bin` + - Set "Path to Unrar" to `/usr/bin/unrar` ## Contributor Recognition diff --git a/cps/clean_html.py b/cps/clean_html.py index 907bc59e..fc4fe6d1 100644 --- a/cps/clean_html.py +++ b/cps/clean_html.py @@ -35,7 +35,7 @@ def clean_string(unsafe_text, book_id=0): try: if bleach: allowed_tags = list(ALLOWED_TAGS) - allowed_tags.extend(['p', 'span', 'div', 'pre']) + allowed_tags.extend(["p", "span", "div", "pre", "h1", "h2", "h3", "h4", "h5", "h6"]) safe_text = clean_html(unsafe_text, tags=set(allowed_tags)) else: safe_text = clean_html(unsafe_text) diff --git a/cps/editbooks.py b/cps/editbooks.py index 64786c99..4a588c57 100644 --- a/cps/editbooks.py +++ b/cps/editbooks.py @@ -23,7 +23,7 @@ import os from datetime import datetime import json -from shutil import copyfile, move +from shutil import copyfile from uuid import uuid4 from markupsafe import escape, Markup # dependency of flask from functools import wraps diff --git a/cps/file_helper.py b/cps/file_helper.py index 8e2b6847..ff0bebea 100644 --- a/cps/file_helper.py +++ b/cps/file_helper.py @@ -21,7 +21,6 @@ import os import shutil import zipfile import mimetypes -import copy from io import BytesIO try: import magic diff --git a/cps/metadata_provider/lubimyczytac.py b/cps/metadata_provider/lubimyczytac.py index 02a96992..9d4a99f8 100644 --- a/cps/metadata_provider/lubimyczytac.py +++ b/cps/metadata_provider/lubimyczytac.py @@ -137,7 +137,7 @@ class LubimyCzytac(Metadata): def _prepare_query(self, title: str) -> str: query = "" - characters_to_remove = "\?()\/" + characters_to_remove = r"\?()\/" pattern = "[" + characters_to_remove + "]" title = re.sub(pattern, "", title) title = title.replace("_", " ")