mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +00:00
🐛 Fix honey wiki data parse
This commit is contained in:
parent
30ea0b99cb
commit
ac879cc353
@ -208,7 +208,7 @@ class WikiModel(Model):
|
|||||||
chaos_data = re.findall(r"sortable_data\.push\((.*?)\);\s*sortable_cur_page", response.text)[0]
|
chaos_data = re.findall(r"sortable_data\.push\((.*?)\);\s*sortable_cur_page", response.text)[0]
|
||||||
json_data = jsonlib.loads(chaos_data) # 转为 json
|
json_data = jsonlib.loads(chaos_data) # 转为 json
|
||||||
for data in json_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
|
if with_url: # 如果需要返回对应的 url
|
||||||
data_url = HONEY_HOST.join(re.findall(r"\"(.*?)\"", data[0])[0])
|
data_url = HONEY_HOST.join(re.findall(r"\"(.*?)\"", data[0])[0])
|
||||||
await queue.put((data_name, data_url))
|
await queue.put((data_name, data_url))
|
||||||
|
@ -202,6 +202,9 @@ class WishLogPlugin(Plugin.Conversation):
|
|||||||
if message.document:
|
if message.document:
|
||||||
await self.import_from_file(user, message)
|
await self.import_from_file(user, message)
|
||||||
return ConversationHandler.END
|
return ConversationHandler.END
|
||||||
|
if not message.text:
|
||||||
|
await message.reply_text("请发送文件或链接")
|
||||||
|
return INPUT_URL
|
||||||
authkey = from_url_get_authkey(message.text)
|
authkey = from_url_get_authkey(message.text)
|
||||||
reply = await message.reply_text("小派蒙正在从服务器获取数据,请稍后")
|
reply = await message.reply_text("小派蒙正在从服务器获取数据,请稍后")
|
||||||
await message.reply_chat_action(ChatAction.TYPING)
|
await message.reply_chat_action(ChatAction.TYPING)
|
||||||
|
Loading…
Reference in New Issue
Block a user