Przeglądaj źródła

fix: remove mini-program url

master
zhayujie 1 rok temu
rodzic
commit
f3de4dcc5f
2 zmienionych plików z 7 dodań i 2 usunięć
  1. +1
    -1
      plugins/linkai/linkai.py
  2. +6
    -1
      plugins/linkai/summary.py

+ 1
- 1
plugins/linkai/linkai.py Wyświetl plik

@@ -31,7 +31,7 @@ class LinkAI(Plugin):
self.sum_config = {}
if self.config:
self.sum_config = self.config.get("summary")
logger.info("[LinkAI] inited")
logger.info(f"[LinkAI] inited, config={self.config}")


def on_handle_context(self, e_context: EventContext):


+ 6
- 1
plugins/linkai/summary.py Wyświetl plik

@@ -82,8 +82,13 @@ class LinkSummary:
if not url:
return False
support_list = ["http://mp.weixin.qq.com", "https://mp.weixin.qq.com"]
black_support_list = ["https://mp.weixin.qq.com/mp/waerrpage"]
for black_url_prefix in black_support_list:
if url.strip().startswith(black_url_prefix):
logger.warn(f"[LinkSum] unsupported url, no need to process, url={url}")
return False
for support_url in support_list:
if url.strip().startswith(support_url):
return True
logger.debug("[LinkSum] unsupported url, no need to process")
logger.warn(f"[LinkSum] unsupported url, no need to process, url={url}")
return False

Ładowanie…
Anuluj
Zapisz