Skip to content

Commit

Permalink
fix: remove mini-program url
Browse files Browse the repository at this point in the history
  • Loading branch information
zhayujie committed Sep 29, 2023
1 parent e345230 commit f3de4dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/linkai/linkai.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self):
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):
Expand Down
7 changes: 6 additions & 1 deletion plugins/linkai/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,13 @@ def check_url(self, url: str):
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

0 comments on commit f3de4dc

Please sign in to comment.