AuthLite PowerOn初步实现和其他改进

This commit is contained in:
Remik1r3n
2025-02-21 23:34:49 +08:00
parent 47cbd5b09a
commit 55bd19717a
10 changed files with 177 additions and 57 deletions

View File

@@ -33,8 +33,14 @@ def apiDivingFish(method:str, apiPath:str, importToken:str, data=None):
url=BASE_URL + apiPath,
headers=headers,
)
elif method == 'DELETE':
response = requests.delete(
url=BASE_URL + apiPath,
headers=headers,
)
else:
raise NotImplementedError
logger.error(f'未知的请求方法:{method}')
raise ValueError(f'未知的请求方法:{method}')
logger.info(f'水鱼查分器请求结果:{response.status_code}')
logger.debug(f'水鱼查分器回应:{response.text}')
@@ -104,9 +110,41 @@ def implUserMusicToDivingFish(userId:int, fishImportToken:str):
return False
return len(divingFishData)
def generateDebugTestScore():
'''生成测试成绩'''
return [
{
"achievement": 1010000,
"comboStatus": 4,
"deluxscoreMax": 4026,
"level": 4,
"musicId": 834,
"syncStatus": 4
},
{
"achievement": 1010000,
"comboStatus": 4,
"deluxscoreMax": 4200,
"level": 4,
"musicId": 11663,
"syncStatus": 4
}
]
def implResetFishUser(fishImportToken:str):
'''重置水鱼查分器的用户数据'''
logger.info("开始重置水鱼查分器的用户数据..")
result = apiDivingFish('DELETE', '/player/delete_records', fishImportToken)
if result:
logger.info("重置成功!")
return True
logger.error("重置失败!")
return False
if __name__ == '__main__':
if True:
userId = testUid2
importToken = testImportToken
#currentLoginTimestamp = generateTimestamp()
implUserMusicToDivingFish(userId, importToken)
#implUserMusicToDivingFish(userId, importToken)
implResetFishUser(importToken)