Merge pull request #1249 from noahzark/patch-3

修复B站转发卡片BUG
This commit is contained in:
HibiKier 2023-02-05 17:28:20 +08:00 committed by GitHub
commit 4d133ed2df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,7 @@ async def _(event: GroupMessageEvent):
data = None
if data:
# 转发视频
if data.get("desc") == "哔哩哔哩":
if data.get("desc") == "哔哩哔哩" or data.get('prompt').find('哔哩哔哩') != -1:
async with aiohttp.ClientSession(
headers=get_user_agent()
) as session:
@ -64,6 +64,8 @@ async def _(event: GroupMessageEvent):
timeout=7,
) as response:
url = str(response.url).split("?")[0]
if url[-1] == '/':
url = url[:-1]
bvid = url.split("/")[-1]
vd_info = await video.get_video_base_info(bvid)
# 转发专栏