diff --git a/src/plugins/jx3/events/__init__.py b/src/plugins/jx3/events/__init__.py index 4dbdb970e..074f89c98 100644 --- a/src/plugins/jx3/events/__init__.py +++ b/src/plugins/jx3/events/__init__.py @@ -34,9 +34,9 @@ async def _(event: GroupMessageEvent, args: Message = CommandArg()): async def _(event: GroupMessageEvent, args: Message = CommandArg()): if args.extract_plain_text() != "": return - # server = server_mapping(args.extract_plain_text(), str(event.group_id)) - # if server == None: - # await zhue_.finish(PROMPT.ServerNotExist) - # else: - # image = await getZhueRecord(server) - # await zhue_.finish(ms.image(image)) \ No newline at end of file + server = server_mapping(args.extract_plain_text(), str(event.group_id)) + if server == None: + await zhue_.finish(PROMPT.ServerNotExist) + else: + image = await getZhueRecord(server) + await zhue_.finish(ms.image(image)) \ No newline at end of file diff --git a/src/plugins/jx3/events/zhue.py b/src/plugins/jx3/events/zhue.py index bb2519184..fdc584662 100644 --- a/src/plugins/jx3/events/zhue.py +++ b/src/plugins/jx3/events/zhue.py @@ -6,6 +6,10 @@ from src.tools.generate import generate, get_uuid from src.tools.utils.path import ASSETS, CACHE, VIEWS from src.tools.utils.common import getCurrentTime, convert_time, getRelateTime +from src.tools.basic.data_server import Zone_mapping + +import json +import time token = Config.jx3.api.token @@ -17,15 +21,44 @@ """ async def getZhueRecord(server: str): - api = f"{Config.jx3.api.url}/data/server/antivice?token={token}&server={server}" - data = await get_api(api) - data = data["data"] + headers = { + "Accept": "application/json, text/javascript, */*; q=0.01", + "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6", + "Cache-Control": "no-cache", + "Connection": "keep-alive", + "Content-Type": "application/json", + "Pragma": "no-cache", + "Sec-Fetch-Dest": "empty", + "Sec-Fetch-Mode": "cors", + "Sec-Fetch-Site": "same-origin", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.82", + "X-Requested-With": "XMLHttpRequest", + "sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Microsoft Edge\";v=\"114\"", + "sec-ch-ua-mobile": "?0", + "sec-ch-ua-platform": "\"Windows\"", + "Referer": "https://www.jx3mm.com/jx3fun/jevent/index.html" + } + filter = { + "Zone": Zone_mapping(server), + "Srv": server + } + base_params = { + "sort": "Tm", + "order": "desc", + "limit": 30, + "offset": 0, + "_": int(time.time()) * 1000, + "filter": json.dumps(filter, ensure_ascii=False), + "op": "{\"Zone\":\"LIKE\",\"Srv\":\"LIKE\"}" + } + api = "https://www.jx3mm.com/jx3fun/jevent" + data = await get_api(api, headers=headers, params=base_params) + data = data["rows"] tables = [] for i in data: - relateTime = getRelateTime(getCurrentTime(), i["time"]) - tables.append(template_zhue.replace("$time", convert_time(i["time"])).replace("$map", i["map_name"]).replace("$relate", relateTime)) + relateTime = getRelateTime(getCurrentTime(), i["Tm"]) + tables.append(template_zhue.replace("$time", convert_time(i["Tm"])).replace("$map", i["Content"]).replace("$relate", relateTime)) saohua = "严禁将蓉蓉机器人与音卡共存,一经发现永久封禁!蓉蓉是抄袭音卡的劣质机器人!" - appinfo_time = convert_time(getCurrentTime(), "%H:%M:%S") appinfo = f" · 诛恶记录 · {server} · {appinfo_time}" final_table = "\n".join(tables)