mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-20 13:47:15 +08:00
fix: remove mini-program url
This commit is contained in:
@@ -31,7 +31,7 @@ class LinkAI(Plugin):
|
|||||||
self.sum_config = {}
|
self.sum_config = {}
|
||||||
if self.config:
|
if self.config:
|
||||||
self.sum_config = self.config.get("summary")
|
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):
|
def on_handle_context(self, e_context: EventContext):
|
||||||
|
|||||||
@@ -82,8 +82,13 @@ class LinkSummary:
|
|||||||
if not url:
|
if not url:
|
||||||
return False
|
return False
|
||||||
support_list = ["http://mp.weixin.qq.com", "https://mp.weixin.qq.com"]
|
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:
|
for support_url in support_list:
|
||||||
if url.strip().startswith(support_url):
|
if url.strip().startswith(support_url):
|
||||||
return True
|
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
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user