From f6a3b55507ca26ca7337bdb0cca8df9cebdb4699 Mon Sep 17 00:00:00 2001 From: mokurin000 <1348292515a@gmail.com> Date: Sun, 3 Aug 2025 12:32:42 +0800 Subject: [PATCH] chore: GetAny --- API_TitleServer.py | 1 - Best50_To_Diving_Fish.py | 7 +++++++ GetAny.py | 24 ++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 GetAny.py diff --git a/API_TitleServer.py b/API_TitleServer.py index 7a42e3b..f97b3e2 100644 --- a/API_TitleServer.py +++ b/API_TitleServer.py @@ -149,7 +149,6 @@ def apiSDGB( # 处理响应内容 responseContentRaw = response.content - print(list(responseContentRaw)) # 先尝试解密 try: diff --git a/Best50_To_Diving_Fish.py b/Best50_To_Diving_Fish.py index 938060a..dd1aad1 100644 --- a/Best50_To_Diving_Fish.py +++ b/Best50_To_Diving_Fish.py @@ -190,3 +190,10 @@ def generateDebugTestScore(): "syncStatus": 4, }, ] + + +if __name__ == "__main__": + userId = int(input("userId: ")) + fishImportToken = input("DivingFish Token: ") + + implUserMusicToDivingFish(userId, fishImportToken) diff --git a/GetAny.py b/GetAny.py new file mode 100644 index 0000000..4a21041 --- /dev/null +++ b/GetAny.py @@ -0,0 +1,24 @@ +# 获取用户简略预览数据的 API 实现,此 API 无需任何登录即可调取 + +import rapidjson as json +from API_TitleServer import apiSDGB + + +def apiGetAny( + userId, + apiName: str, + noLog: bool = False, +) -> str: + data = json.dumps({"userId": int(userId)}) + preview_result = apiSDGB(data, apiName, userId, noLog) + return preview_result + + +# CLI 示例 +if __name__ == "__main__": + userId = input("请输入用户 ID:") + # userId = testUid8 + # print(apiGetAny(userId, "GetUserRatingApi")) + # print(apiGetAny(userId, "GetUserPreviewApi")) + print(apiGetAny(userId, "GetUserCourseApi")) + print(apiGetAny(userId, "GetUserExtendApi"))