mirror of
https://github.com/Remik1r3n/maimaiDX-Api.git
synced 2025-05-20 01:07:28 +08:00
更新包获取和b50更新的小改进
This commit is contained in:
parent
36af0f5dd6
commit
a87a459ac3
@ -28,8 +28,8 @@ def auth_lite_decrypt(ciphertext: bytes) -> str:
|
||||
content = decrypted_data[16:] # 去除头部的16字节
|
||||
return content.decode('utf-8').strip()
|
||||
|
||||
def getRawDelivery():
|
||||
encrypted = auth_lite_encrypt('title_id=SDGB&title_ver=1.40&client_id=A63E01C2805')
|
||||
def getRawDelivery(title_ver:str="1.41"):
|
||||
encrypted = auth_lite_encrypt(f'title_id=SDGB&title_ver={title_ver}&client_id=A63E01C2805')
|
||||
r = httpx.post(
|
||||
'http://at.sys-allnet.cn/net/delivery/instruction',
|
||||
data = encrypted,
|
||||
@ -89,8 +89,8 @@ def parseUpdateIni(iniText):
|
||||
|
||||
# 根据前缀选择消息模板和图标
|
||||
prefix_icons = {
|
||||
'PATCH': ('💾 游戏程序更新 ', 'PATCH_'),
|
||||
'OPTION': ('📚 游戏内容更新 ', 'OPTION_')
|
||||
'PATCH': ('💾 游戏程序更新 (.app) ', 'PATCH_'),
|
||||
'OPTION': ('📚 游戏内容更新 (.opt) ', 'OPTION_')
|
||||
}
|
||||
icon, prefix = prefix_icons.get(game_desc.split('_')[0], ('📦 游戏更新 ', ''))
|
||||
|
||||
@ -98,20 +98,20 @@ def parseUpdateIni(iniText):
|
||||
game_title = game_desc.replace(prefix, '', 1)
|
||||
message.append(f"{icon}{game_title}")
|
||||
|
||||
# 添加可选文件的下载链接(如果有)
|
||||
if 'OPTIONAL' in config:
|
||||
message.append("往期更新包:")
|
||||
optional_files = [f"{url.split('/')[-1]} {url}" for _, url in config.items('OPTIONAL')]
|
||||
message.extend(optional_files)
|
||||
|
||||
# 添加主文件的下载链接
|
||||
main_file = common['INSTALL1']
|
||||
main_file_name = main_file.split('/')[-1]
|
||||
message.append(f"下载: \n- [{main_file_name}]({main_file})")
|
||||
|
||||
# 添加可选文件的下载链接(如果有)
|
||||
if 'OPTIONAL' in config:
|
||||
message.append("其它文件:")
|
||||
optional_files = [f"- [{url.split('/')[-1]}]({url})" for _, url in config.items('OPTIONAL')]
|
||||
message.extend(optional_files)
|
||||
|
||||
message.append(f"此次更新包: \n{main_file_name} {main_file}")
|
||||
|
||||
# 添加发布时间信息
|
||||
release_time = common['RELEASE_TIME'].replace('T', ' ')
|
||||
message.append(f"将于 {release_time} 发布。\n")
|
||||
message.append(f"正式发布时间:{release_time}。\n")
|
||||
|
||||
# 构建最终的消息字符串
|
||||
final_message = '\n'.join(message)
|
||||
|
@ -54,6 +54,10 @@ def getFishRecords(importToken: str) -> dict:
|
||||
def updateFishRecords(importToken: str, records: list[dict]) -> dict:
|
||||
return apiDivingFish('POST', '/player/update_records', importToken, records)
|
||||
|
||||
def resetFishRecords(fishImportToken:str):
|
||||
'''重置水鱼查分器的用户数据'''
|
||||
return apiDivingFish('DELETE', '/player/delete_records', fishImportToken)
|
||||
|
||||
def maimaiUserMusicDetailToDivingFishFormat(userMusicDetailList) -> list:
|
||||
'''舞萌的 UserMusicDetail 成绩格式转换成水鱼的格式'''
|
||||
divingFishList = []
|
||||
@ -131,16 +135,6 @@ def generateDebugTestScore():
|
||||
}
|
||||
]
|
||||
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user