diff --git a/src/nonebot_plugin_parser/parsers/xiaohongshu/__init__.py b/src/nonebot_plugin_parser/parsers/xiaohongshu/__init__.py index e79b65ca..808d451c 100644 --- a/src/nonebot_plugin_parser/parsers/xiaohongshu/__init__.py +++ b/src/nonebot_plugin_parser/parsers/xiaohongshu/__init__.py @@ -33,7 +33,7 @@ def __init__(self): self.headers["cookie"] = pconfig.xhs_ck self.ios_headers["cookie"] = pconfig.xhs_ck - @handle("xhslink.com", r"xhslink\.com/[A-Za-z0-9._?%&+=/#@-]+") + @handle("xhslink", r"xhslink\.(com|cn)/[A-Za-z0-9._?%&+=/#@-]+") async def _parse_short_link(self, searched: re.Match[str]): url = f"https://{searched.group(0)}" return await self.parse_with_redirect(url, self.ios_headers) diff --git a/tests/others/test_urls.md b/tests/others/test_urls.md index 99bde101..8f226a0a 100644 --- a/tests/others/test_urls.md +++ b/tests/others/test_urls.md @@ -65,6 +65,7 @@ douyin: xiaohongshu: 测试前先检查链接是否能访问 - http://xhslink.com/o/49ufwc0ipbn +- http://xhslink.cn/o/8bNxn8Tbi0r - https://www.xiaohongshu.com/discovery/item/68e8e3fa00000000030342ec?app_platform=android&ignoreEngage=true&app_version=9.6.0&share_from_user_hidden=true&xsec_source=app_share&type=normal&xsec_token=CBW9rwIV2qhcCD-JsQAOSHd2tTW9jXAtzqlgVXp6c52Sw%3D&author_share=1&xhsshare=QQ&shareRedId=ODs3RUk5ND42NzUyOTgwNjY3OTo8S0tK&apptime=1761372823&share_id=3b61945239ac403db86bea84a4f15124&share_channel=qq - https://www.xiaohongshu.com/explore/68e8e3fa00000000030342ec?app_platform=android&ignoreEngage=true&app_version=9.6.0&share_from_user_hidden=true&xsec_source=app_share&type=normal&xsec_token=CBW9rwIV2qhcCD-JsQAOSHd2tTW9jXAtzqlgVXp6c52Sw%3D&author_share=1&xhsshare=QQ&shareRedId=ODs3RUk5ND42NzUyOTgwNjY3OTo8S0tK&apptime=1761372823&share_id=3b61945239ac403db86bea84a4f15124&share_channel=qq