😃 添加获取视频成功后的通知

This commit is contained in:
xtaodada 2020-02-20 16:08:50 +08:00
parent bffa63fa58
commit f26b6805e7
No known key found for this signature in database
GPG Key ID: 39EFACA711DF5D8C
2 changed files with 4 additions and 1 deletions

View File

@ -28,10 +28,12 @@ async def ybdl(context):
if not await fetch_video(url, context.chat_id, reply_id):
await context.edit("出错了呜呜呜 ~ 视频下载失败。")
await log(f"已拉取UTB视频地址 {url}.")
await context.edit("视频获取成功!")
if bilibili_pattern.match(url):
if not await fetch_video(url, context.chat_id, reply_id):
await context.edit("出错了呜呜呜 ~ 视频下载失败。")
await log(f"已拉取 Bilibili 视频,地址: {url}.")
await context.edit("视频获取成功!")
async def fetch_video(url, chat_id, reply_id):
""" Extracts and uploads YouTube video. """

View File

@ -15,7 +15,7 @@ async def ytdl(context):
url = context.arguments
reply = await context.get_reply_message()
reply_id = None
await context.edit("正在拉取视频 . . .")
await context.edit("获取视频中 . . .")
if reply:
reply_id = reply.id
if url is None:
@ -27,6 +27,7 @@ async def ytdl(context):
if not await fetch_youtube_video(url, context.chat_id, reply_id):
await context.edit("出错了呜呜呜 ~ 视频下载失败。")
await log(f"已拉取UTB视频地址 {url}.")
await context.edit("视频获取成功!")
async def fetch_youtube_video(url, chat_id, reply_id):