diff --git a/GenshinUID/genshinuid_collection/draw_collection_card.py b/GenshinUID/genshinuid_collection/draw_collection_card.py index b27859ce..886498f0 100644 --- a/GenshinUID/genshinuid_collection/draw_collection_card.py +++ b/GenshinUID/genshinuid_collection/draw_collection_card.py @@ -23,14 +23,14 @@ red_color = (255, 66, 66) green_color = (74, 189, 119) max_data = { - '成就': 892, + '成就': 939, '华丽的宝箱': 185, - '珍贵的宝箱': 487, - '精致的宝箱': 1589, - '普通的宝箱': 2527, + '珍贵的宝箱': 503, + '精致的宝箱': 1629, + '普通的宝箱': 2632, '奇馈宝箱': 146, - '解锁传送点': 286, - '解锁秘境': 48, + '解锁传送点': 303, + '解锁秘境': 51, } award_data = { diff --git a/GenshinUID/genshinuid_config/config_default.py b/GenshinUID/genshinuid_config/config_default.py index 313dd906..80a8ad8c 100644 --- a/GenshinUID/genshinuid_config/config_default.py +++ b/GenshinUID/genshinuid_config/config_default.py @@ -17,6 +17,11 @@ CONIFG_DEFAULT: Dict[str, GSC] = { '用于面板查询的随机图API', 'https://genshin-res.cherishmoon.fun/img?name=', ), + 'restart_command': GsStrConfig( + '重启命令', + '自定义使用gs重启时触发的控制台命令(看不懂勿改)', + 'poetry run python', + ), 'Ann_Groups': GsDictConfig( '推送公告群组', '原神公告推送群组', diff --git a/GenshinUID/genshinuid_config/gs_config.py b/GenshinUID/genshinuid_config/gs_config.py index 5642329c..cb64b929 100644 --- a/GenshinUID/genshinuid_config/gs_config.py +++ b/GenshinUID/genshinuid_config/gs_config.py @@ -13,7 +13,7 @@ from .models import ( GsListStrConfig, ) -STR_CONFIG = Literal['proxy', '_pass_API', 'random_pic_API'] +STR_CONFIG = Literal['proxy', '_pass_API', 'random_pic_API', 'restart_command'] LIST_INT_CONFIG = Literal['Ann_Ids'] LIST_STR_CONFIG = Literal['SignTime', 'BBSTaskTime'] DICT_CONFIG = Literal['Ann_Groups'] diff --git a/GenshinUID/genshinuid_gachalog/export_and_import.py b/GenshinUID/genshinuid_gachalog/export_and_import.py index c5f4efe2..b4c4c78e 100644 --- a/GenshinUID/genshinuid_gachalog/export_and_import.py +++ b/GenshinUID/genshinuid_gachalog/export_and_import.py @@ -21,7 +21,10 @@ async def import_gachalogs(history_url: str, type: str, uid: str) -> str: history_data: dict = json.loads(get(history_url).text) else: data_bytes = base64.b64decode(history_url) - history_data = json.loads(data_bytes.decode('gbk')) + try: + history_data = json.loads(data_bytes.decode()) + except UnicodeDecodeError: + history_data = json.loads(data_bytes.decode('gbk')) if 'info' in history_data and 'uid' in history_data['info']: data_uid = history_data['info']['uid'] if data_uid != uid: diff --git a/GenshinUID/genshinuid_update/restart.py b/GenshinUID/genshinuid_update/restart.py index 3ec3a48f..6a55615d 100644 --- a/GenshinUID/genshinuid_update/restart.py +++ b/GenshinUID/genshinuid_update/restart.py @@ -5,6 +5,8 @@ import platform import subprocess from pathlib import Path +from ..genshinuid_config.gs_config import gsconfig + bot_start = Path(__file__).parents[4] / 'core.py' restart_sh_path = Path().cwd() / 'gs_restart.sh' update_log_path = Path(__file__).parent / 'update_log.json' @@ -13,9 +15,11 @@ _restart_sh = '''#!/bin/bash kill -9 {} {} &''' +restart_command = gsconfig.get_config('restart_command').data + async def get_restart_sh() -> str: - args = f'poetry run python {str(bot_start.absolute())}' + args = f'{restart_command} {str(bot_start.absolute())}' return _restart_sh.format(str(bot_start.absolute()), args) @@ -42,12 +46,12 @@ async def restart_genshinuid( json.dump(update_log, f) if platform.system() == 'Linux': subprocess.Popen( - f'kill -9 {pid} & poetry run python {bot_start}', + f'kill -9 {pid} & {restart_command} {bot_start}', shell=True, ) else: subprocess.Popen( - f'taskkill /F /PID {pid} & poetry run python {bot_start}', + f'taskkill /F /PID {pid} & {restart_command} {bot_start}', shell=True, ) diff --git a/GenshinUID/utils/map/data/char_alias.json b/GenshinUID/utils/map/data/char_alias.json index 8ad45836..b03ed95c 100644 --- a/GenshinUID/utils/map/data/char_alias.json +++ b/GenshinUID/utils/map/data/char_alias.json @@ -619,7 +619,8 @@ "茄子", "紫茄子", "阿忍", - "忍姐" + "忍姐", + "九岐忍" ], "神里绫人": [ "Kamisato Ayato", @@ -669,7 +670,8 @@ "Nilou", "nilou", "尼露", - "尼禄" + "尼禄", + "红牛" ], "赛诺": [ "Cyno", diff --git a/GenshinUID/version.py b/GenshinUID/version.py index 3e1a062a..62e90ad8 100644 --- a/GenshinUID/version.py +++ b/GenshinUID/version.py @@ -1,2 +1,2 @@ -GenshinUID_version = '3.1.0' +GenshinUID_version = '4.0.2' Genshin_version = '3.6.0'