av号覆盖全面

This commit is contained in:
q56535 2022-08-23 13:43:43 +08:00 committed by GitHub
parent 6c93769838
commit 8e1a416be3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,10 +110,10 @@ async def _(event: GroupMessageEvent):
vd_info = await video.get_video_base_info(msg)
elif "av" in msg:
index = msg.find("av")
if len(msg[index + 2 :]) >= 9:
if len(msg[index + 2 :]) >= 1:
msg = msg[index + 2 : index + 11]
if is_number(msg):
url = f"https://www.bilibili.com/video/{msg}"
url = f"https://www.bilibili.com/video/av{msg}"
vd_info = await video.get_video_base_info('av' + msg)
elif "https://b23.tv" in msg:
url = "https://" + msg[msg.find("b23.tv"): msg.find("b23.tv") + 14]