mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-Nonebot.git
synced 2026-04-01 22:04:51 +00:00
取消视频下载流程
This commit is contained in:
parent
2e6ba61a4f
commit
5ac73876b4
1 changed files with 8 additions and 6 deletions
|
|
@ -69,15 +69,16 @@ async def get_video_file(message: MessageEvent):
|
|||
|
||||
cid = pages[0]['cid']
|
||||
video_url = biliVideos.get_video_file_url(keyword[0], cid)
|
||||
biliVideos.video_download(video_url, cid)
|
||||
# biliVideos.video_download(video_url, cid)
|
||||
# biliVideos.transcode_video(f"{cid}.mp4",f"{cid}-o.mp4")
|
||||
|
||||
try:
|
||||
await bili_bv_search.send(Message(MessageSegment.file_video(Path(f"./src/videos/file/{cid}.mp4"))))
|
||||
# await bili_bv_search.send(Message(MessageSegment.file_video(Path(f"./src/videos/file/{cid}.mp4"))))
|
||||
await bili_bv_search.send(MessageSegment.video(video_url))
|
||||
except nonebot.adapters.qq.exception.ActionFailed:
|
||||
await bili_bv_search.finish("发送失败惹,可能是视频过长,请尽量搜索1分钟以内的视频吧。")
|
||||
|
||||
biliVideos.delete_video(cid)
|
||||
# biliVideos.delete_video(cid)
|
||||
|
||||
elif len(keyword) >= 2:
|
||||
|
||||
|
|
@ -100,13 +101,14 @@ async def get_video_file(message: MessageEvent):
|
|||
|
||||
cid = pages[page_num - 1]['cid']
|
||||
video_url = biliVideos.get_video_file_url(keyword[0], cid)
|
||||
biliVideos.video_download(video_url, cid)
|
||||
# biliVideos.video_download(video_url, cid)
|
||||
|
||||
try:
|
||||
await bili_bv_search.send(Message(MessageSegment.file_video(Path(f"./src/videos/file/{cid}.mp4"))))
|
||||
# await bili_bv_search.send(Message(MessageSegment.file_video(Path(f"./src/videos/file/{cid}.mp4"))))
|
||||
await bili_bv_search.send(MessageSegment.video(video_url))
|
||||
except nonebot.adapters.qq.exception.ActionFailed:
|
||||
await bili_bv_search.finish("发送失败惹,可能是视频过长,请尽量搜索1分钟以内的视频吧。")
|
||||
|
||||
biliVideos.delete_video(cid)
|
||||
# biliVideos.delete_video(cid)
|
||||
|
||||
await bili_bv_search.finish()
|
||||
|
|
|
|||
Loading…
Reference in a new issue