Pārlūkot izejas kodu

fix: remove mini-program url

master
zhayujie pirms 1 gada
vecāks
revīzija
f3de4dcc5f
2 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. +1
    -1
      plugins/linkai/linkai.py
  2. +6
    -1
      plugins/linkai/summary.py

+ 1
- 1
plugins/linkai/linkai.py Parādīt failu

@@ -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 Parādīt failu

@@ -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

Notiek ielāde…
Atcelt
Saglabāt