From 22c5d7b619ce50f3ad4bfcee23dc6cee398d90a6 Mon Sep 17 00:00:00 2001 From: fllesser Date: Sat, 25 Jul 2026 10:41:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E5=B0=8F=E7=BA=A2?= =?UTF-8?q?=E4=B9=A6=20cn=20=E7=9F=AD=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/nonebot_plugin_parser/parsers/xiaohongshu/__init__.py | 2 +- tests/others/test_urls.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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