AuthLite PowerOn初步实现和其他改进
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user