diff --git a/API_TitleServer.py b/API_TitleServer.py index 45d6d64..f97b3e2 100644 --- a/API_TitleServer.py +++ b/API_TitleServer.py @@ -16,16 +16,18 @@ from Config import ( proxyUrl, ) -use2024Api = False # 是否使用 2024 API -if use2024Api: +AesKey = "a>32bVP7v<63BVLkY[xM>daZ1s9MBP str: data = json.dumps({"userId": int(userId)}) preview_result = apiSDGB(data, "GetUserPreviewApi", userId, noLog) - print(apiSDGB("{}", "Ping", userId, noLog)) return preview_result @@ -16,3 +15,4 @@ if __name__ == "__main__": userId = input("请输入用户 ID:") # userId = testUid8 print(apiGetUserPreview(userId)) + print(apiSDGB("{}", "Ping", userId, False)) diff --git a/GetPreview2024.py b/GetPreview2024.py new file mode 100644 index 0000000..cf964f6 --- /dev/null +++ b/GetPreview2024.py @@ -0,0 +1,21 @@ +# 获取用户简略预览数据的 API 实现,此 API 无需任何登录即可调取 + +import rapidjson as json + +from API_TitleServer import apiSDGB_2024, use2024Api + +use2024Api() + + +def apiGetUserPreview(userId, noLog: bool = False) -> str: + data = json.dumps({"userId": int(userId)}) + preview_result = apiSDGB_2024(data, "GetUserPreviewApi", userId, noLog) + return preview_result + + +# CLI 示例 +if __name__ == "__main__": + userId = input("请输入用户 ID:") + # userId = testUid8 + # print(apiGetUserPreview(userId)) + print(apiSDGB_2024("{}", "Ping", userId, False))