forked from Kohaku/maimaiDX-Api
minus
This commit is contained in:
parent
d194556eee
commit
6daf529b2f
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user