Archived
1
0
Fork 0
This commit is contained in:
多羅狼 2024-01-18 00:18:02 +08:00 committed by GitHub
parent a8804f0c2d
commit 698001985a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -23,8 +23,8 @@ async def _(msg: Bot.MessageSession, bid: str, get_detail=False):
else:
return await msg.finish(msg.locale.t('bilibili.message.error.invalid'))
res = await get_video_info(msg, query, get_detail)
if not res:
await msg.finish(msg.locale.t('message.cooldown', time=int(c), cd_time='30'))
if res:
await msg.finish(msg.locale.t('message.cooldown', time=int(res), cd_time='30'))
@bili.regex(re.compile(r"av(\d+)", flags=re.I), mode='M', desc="{bilibili.help.regex.av}")
@ -75,7 +75,7 @@ async def parse_shorturl(shorturl):
target_url = response.headers.get('Location')
video = re.search(r'/video/([^/?]+)', target_url)
if video:
if video:
url = f"{api_url}?bvid={video.group(1)}"
return url
else:

View file

@ -73,7 +73,7 @@ async def get_video_info(msg: Bot.MessageSession, query, get_detail=False):
qc.reset()
await msg.finish([Image(pic), Url(video_url), Plain(output)])
else:
return None
return c
def format_num(number):