Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -44,7 +44,8 @@ def apiDivingFish(method:str, apiPath:str, importToken:str, data=None):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user