From 151e8c69f92db510402581e8437216388b6a40d8 Mon Sep 17 00:00:00 2001 From: befantasy <31535803+befantasy@users.noreply.github.com> Date: Fri, 15 Sep 2023 18:22:10 +0800 Subject: [PATCH] Update keyword.py --- plugins/keyword/keyword.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/keyword/keyword.py b/plugins/keyword/keyword.py index 5c9f48e..87cd054 100644 --- a/plugins/keyword/keyword.py +++ b/plugins/keyword/keyword.py @@ -75,6 +75,12 @@ class Keyword(Plugin): reply = Reply() reply.type = ReplyType.FILE reply.content = file_path + + elif (reply_text.startswith("http://") or reply_text.startswith("https://")) and any(reply_text.endswith(ext) for ext in [".mp4"]): + # 如果是以 http:// 或 https:// 开头,且".mp4"结尾,则下载视频到tmp目录并发送给用户 + reply = Reply() + reply.type = ReplyType.VIDEO_URL + reply.content = reply_text else: # 否则认为是普通文本