From e0da5bb943720a0c977a38d537f23a9b49ef9ee5 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Wed, 5 Mar 2025 19:05:33 +0800 Subject: [PATCH] chore: delete some files for project safety --- .../content_safety_check/strategies/keywords.py | 15 ++++++--------- .../content_safety_check/strategies/unfit_words | 1 - 2 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 astrbot/core/pipeline/content_safety_check/strategies/unfit_words diff --git a/astrbot/core/pipeline/content_safety_check/strategies/keywords.py b/astrbot/core/pipeline/content_safety_check/strategies/keywords.py index e117f47a5..de5b9c456 100644 --- a/astrbot/core/pipeline/content_safety_check/strategies/keywords.py +++ b/astrbot/core/pipeline/content_safety_check/strategies/keywords.py @@ -1,7 +1,4 @@ import re -import os -import json -import base64 from . import ContentSafetyStrategy @@ -11,13 +8,13 @@ class KeywordsStrategy(ContentSafetyStrategy): if extra_keywords is None: extra_keywords = [] self.keywords.extend(extra_keywords) - keywords_path = os.path.join(os.path.dirname(__file__), "unfit_words") + # keywords_path = os.path.join(os.path.dirname(__file__), "unfit_words") # internal keywords - if os.path.exists(keywords_path): - with open(keywords_path, "r", encoding="utf-8") as f: - self.keywords.extend( - json.loads(base64.b64decode(f.read()).decode("utf-8"))["keywords"] - ) + # if os.path.exists(keywords_path): + # with open(keywords_path, "r", encoding="utf-8") as f: + # self.keywords.extend( + # json.loads(base64.b64decode(f.read()).decode("utf-8"))["keywords"] + # ) def check(self, content: str) -> bool: for keyword in self.keywords: diff --git a/astrbot/core/pipeline/content_safety_check/strategies/unfit_words b/astrbot/core/pipeline/content_safety_check/strategies/unfit_words deleted file mode 100644 index 030426e54..000000000 --- a/astrbot/core/pipeline/content_safety_check/strategies/unfit_words +++ /dev/null @@ -1 +0,0 @@ -ewogICAgImtleXdvcmRzIjogWwogICAgICAgICLkuaDov5HlubMiLAogICAgICAgICLog6HplKbmtpsiLAogICAgICAgICLmsZ/ms73msJEiLAogICAgICAgICLmuKnlrrblrp0iLAogICAgICAgICLmnY7lhYvlvLoiLAogICAgICAgICLmnY7plb/mmKUiLAogICAgICAgICLmr5vms73kuJwiLAogICAgICAgICLpgpPlsI/lubMiLAogICAgICAgICLlkajmganmnaUiLAogICAgICAgICLnpL7kvJrkuLvkuYkiLAogICAgICAgICLlhbHkuqflhZoiLAogICAgICAgICLlhbHkuqfkuLvkuYkiLAogICAgICAgICLlpKfpmYblrpjmlrkiLAogICAgICAgICLljJfkuqzmlL/mnYMiLAogICAgICAgICLkuK3ljY7luJ3lm70iLAogICAgICAgICLkuK3lm73mlL/lupwiLAogICAgICAgICLlhbHni5ciLAogICAgICAgICLlha3lm5vkuovku7YiLAogICAgICAgICLlpKnlronpl6giLAogICAgICAgICLlha3lm5siLAogICAgICAgICLmlL/msrvlsYDluLjlp5QiLAogICAgICAgICLlrabmva4iLAogICAgICAgICLlhavkuZ0iLAogICAgICAgICLkuozljYHlpKciLAogICAgICAgICLmsJHov5vlhZoiLAogICAgICAgICLlj7Dni6wiLAogICAgICAgICLlj7Dmub7ni6znq4siLAogICAgICAgICLlj7Dmub7lm70iLAogICAgICAgICLlm73msJHlhZoiLAogICAgICAgICLlj7Dmub7msJHlm70iLAogICAgICAgICLkuK3ljY7msJHlm70iLAogICAgICAgICJwb3JuaHViIiwKICAgICAgICAiUG9ybmh1YiIsCiAgICAgICAgIuS9nOeIsSIsCiAgICAgICAgIuWBmueIsSIsCiAgICAgICAgIuaAp+S6pCIsCiAgICAgICAgIuiHquaFsCIsCiAgICAgICAgIumYtOiMjiIsCiAgICAgICAgIua3q+WmhyIsCiAgICAgICAgIuiCm+S6pCIsCiAgICAgICAgIuS6pOmFjSIsCiAgICAgICAgIuaAp+WFs+ezuyIsCiAgICAgICAgIuaAp+a0u+WKqCIsCiAgICAgICAgIuiJsuaDhSIsCiAgICAgICAgIuiJsuWbviIsCiAgICAgICAgIuijuOS9kyIsCiAgICAgICAgIuWwj+eptCIsCiAgICAgICAgIua3q+iNoSIsCiAgICAgICAgIuaAp+eIsSIsCiAgICAgICAgIua4r+eLrCIsCiAgICAgICAgIuazlei9ruWKnyIsCiAgICAgICAgIuWFreWbmyIKICAgIF0KfQ== \ No newline at end of file