From 6daf529b2ff7f604674fca2c521881c9095d8fa5 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 3 Feb 2025 02:40:26 +0800 Subject: [PATCH] minus --- Best50_To_Diving_Fish.py | 11 ++++++++++- MusicDB.py | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Best50_To_Diving_Fish.py b/Best50_To_Diving_Fish.py index 588be8c..691b81a 100644 --- a/Best50_To_Diving_Fish.py +++ b/Best50_To_Diving_Fish.py @@ -44,7 +44,8 @@ def apiDivingFish(method:str, apiPath:str, importToken:str, data:dict=None) -> d else: raise NotImplementedError - logger.info(f'水鱼查分器请求结果:{response.status_code} {response.text}') + logger.info(f'水鱼查分器请求结果:{response.status_code}') + logger.debug(f'水鱼查分器回应:{response.text}') if response.status_code != 200: return False return response.json() @@ -95,9 +96,17 @@ def isVaildFishToken(importToken:str): result = apiDivingFish('GET', '/player/records', importToken) logger.debug(f"水鱼查分器 Token 检查结果:{result}") if result == False: + logger.info("检查出了一个无效的水鱼token") return False return True +def implUserMusicToDivingFish(userId:int, fishImportToken:str): + '''上传所有成绩到水鱼的参考实现''' + userFullMusicDetailList = getUserFullMusicDetail(userId) + divingFishData = maimaiUserMusicDetailToDivingFishFormat(userFullMusicDetailList) + updateFishRecords(fishImportToken, divingFishData) + + if __name__ == '__main__': if True: userId = testUid diff --git a/MusicDB.py b/MusicDB.py index cc3f11d..88a1bf7 100644 --- a/MusicDB.py +++ b/MusicDB.py @@ -8,7 +8,7 @@ MusicDBType = Dict[int, Dict[str, Union[int, str]]] __all__ = ['musicDB'] # 读取并解析 JSON 文件 -with open('./Data/musicDB.json', 'r', encoding='utf-8') as f: +with open('./maimaiDX-Api/Data/musicDB.json', 'r', encoding='utf-8') as f: # 使用 json.load 直接从文件对象读取 JSON 数据 data = json.load(f)