Commit ceaf970
Changed files (1)
src/networking.py
@@ -341,7 +341,7 @@ async def match_social_media_link(text: str, *, flatten_first: bool = True) -> d
return {"url": f"https://www.xiaohongshu.com/explore/{post_id}?xsec_token={xsec}", "db_key": f"www.xiaohongshu.com/explore/{post_id}", "xsec": xsec, "platform": "xiaohongshu"}
# https://www.bilibili.com/video/BV1TC411J7PK
- if matched := re.search(r"(https?://)?(:?m\.|www\.)?bilibili\.com/video/([^,,.。\s]+)", text):
+ if matched := re.search(r"(https?://)?(:?m\.|www\.)?bilibili\.com/video/(\w+)", text):
base_url = matched.group(0).split("?")[0]
bvid = Path(base_url).stem
queries = parse_qs(urlparse(matched.group(0)).query)