From ac879cc3530a52c67f790f32aba7778f62a15f34 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 25 Apr 2023 19:52:16 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20honey=20wiki=20data=20pars?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/wiki/base.py | 2 +- plugins/genshin/wish_log.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/wiki/base.py b/modules/wiki/base.py index 3b922388..3b5ba7d1 100644 --- a/modules/wiki/base.py +++ b/modules/wiki/base.py @@ -208,7 +208,7 @@ class WikiModel(Model): chaos_data = re.findall(r"sortable_data\.push\((.*?)\);\s*sortable_cur_page", response.text)[0] json_data = jsonlib.loads(chaos_data) # 转为 json for data in json_data: # 遍历 json - data_name = re.findall(r">(.*)<", data[1])[0] # 获取 Model 的名称 + data_name = re.findall(r">(.*)<", data[1])[0].replace("\r", "") # 获取 Model 的名称 if with_url: # 如果需要返回对应的 url data_url = HONEY_HOST.join(re.findall(r"\"(.*?)\"", data[0])[0]) await queue.put((data_name, data_url)) diff --git a/plugins/genshin/wish_log.py b/plugins/genshin/wish_log.py index 9b248f65..a5458b94 100644 --- a/plugins/genshin/wish_log.py +++ b/plugins/genshin/wish_log.py @@ -202,6 +202,9 @@ class WishLogPlugin(Plugin.Conversation): if message.document: await self.import_from_file(user, message) return ConversationHandler.END + if not message.text: + await message.reply_text("请发送文件或链接") + return INPUT_URL authkey = from_url_get_authkey(message.text) reply = await message.reply_text("小派蒙正在从服务器获取数据,请稍后") await message.reply_chat_action(ChatAction.TYPING)