perf: 优化提取链接的正则表达式

This commit is contained in:
2025-06-26 22:25:21 +08:00
parent a916180284
commit 1eea31d5bc
3 changed files with 8 additions and 24 deletions

View File

@@ -73,7 +73,7 @@ class XHS:
VERSION_BETA = VERSION_BETA
LINK = compile(r"https?://www\.xiaohongshu\.com/explore/\S+")
SHARE = compile(r"https?://www\.xiaohongshu\.com/discovery/item/\S+")
SHORT = compile(r"https?://xhslink\.com/\S+")
SHORT = compile(r"https?://xhslink\.com/[^\s\"<>\\^`{|},。;!?、【】《》]+")
ID = compile(r"(?:explore|item)/(\S+)?\?")
__INSTANCE = None
CLEANER = Cleaner()