From 69a923d827f0a9e08d13518faa030432edac2bcc Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Wed, 8 Jun 2022 14:45:03 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8C=96=E5=9D=91=E6=9C=AA=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account.py | 3 +-- tears_of_themis.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 tears_of_themis.py diff --git a/account.py b/account.py index bd0fc57..21950ba 100644 --- a/account.py +++ b/account.py @@ -18,8 +18,7 @@ def stop_module(game_id: str) -> None: elif game_id == "bh3_cn": config.config["games"]["cn"]["honkai3rd"]["auto_checkin"] = False elif game_id == "nxx_cn": - # 未定好像没米游社签到 - pass + config.config["games"]["cn"]["tears_of_themis"]["auto_checkin"] = False elif game_id == "hk4e_cn": config.config["games"]["cn"]["genshin"]["auto_checkin"] = False else: diff --git a/tears_of_themis.py b/tears_of_themis.py new file mode 100644 index 0000000..633689d --- /dev/null +++ b/tears_of_themis.py @@ -0,0 +1,3 @@ +class Tears_of_themis: + def __init__(self) -> None: + pass \ No newline at end of file From 76048a81494cc9f2eba117160dff148a8d1727ff Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Fri, 24 Jun 2022 10:13:29 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B8=85=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- account.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/account.py b/account.py index 21950ba..c12251e 100644 --- a/account.py +++ b/account.py @@ -5,13 +5,6 @@ from loghelper import log from error import CookieError -def game_id2name(game_id: str) -> str: - try: - return setting.game_id2name[game_id] - except NameError: - return game_id - - def stop_module(game_id: str) -> None: if game_id == "bh2_cn": config.config["games"]["cn"]["hokai2"]["auto_checkin"] = False @@ -27,15 +20,15 @@ def stop_module(game_id: str) -> None: def get_account_list(game_id: str, headers: dict) -> list: - log.info(f"正在获取米哈游账号绑定的{game_id2name(game_id)}账号列表...") + log.info(f"正在获取米哈游账号绑定的{setting.game_id2name.get(game_id,game_id)}账号列表...") temp_list = [] req = http.get(setting.account_Info_url + game_id, headers=headers) data = req.json() if data["retcode"] != 0: - log.warning(f"获取{game_id2name(game_id)}账号列表失败!") + log.warning(f"获取{setting.game_id2name.get(game_id,game_id)}账号列表失败!") stop_module(game_id) raise CookieError("BBS Cookie Error") for i in data["data"]["list"]: temp_list.append([i["nickname"], i["game_uid"], i["region"]]) - log.info(f"已获取到{len(temp_list)}个{game_id2name(game_id)}账号信息") + log.info(f"已获取到{len(temp_list)}个{setting.game_id2name.get(game_id,game_id)}账号信息") return temp_list From 6f052f6795c4040f709683b137f5015d78fb669b Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Wed, 6 Jul 2022 09:58:11 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=92=8C=E9=87=8D=E8=AF=95=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- request.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/request.py b/request.py index c8fdd1d..3f460d7 100644 --- a/request.py +++ b/request.py @@ -2,7 +2,7 @@ try: # 优先使用httpx,在httpx无法使用的环境下使用requests import httpx - http = httpx.Client(timeout=10, transport=httpx.HTTPTransport(retries=5)) + http = httpx.Client(timeout=20, transport=httpx.HTTPTransport(retries=10)) # 当openssl版本小于1.0.2的时候直接进行一个空请求让httpx报错 import tools @@ -13,5 +13,5 @@ except (TypeError, ModuleNotFoundError): from requests.adapters import HTTPAdapter http = requests.Session() - http.mount('http://', HTTPAdapter(max_retries=5)) - http.mount('https://', HTTPAdapter(max_retries=5)) + http.mount('http://', HTTPAdapter(max_retries=10)) + http.mount('https://', HTTPAdapter(max_retries=10)) From 7fd69670909e256b0963446ba992932f768c0d2b Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Mon, 18 Jul 2022 15:25:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9C=AA=E5=AE=9A=E6=8C=96=E5=9D=91(?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setting.py | 6 ++++++ tears_of_themis.py => tearsofthemis.py | 0 2 files changed, 6 insertions(+) rename tears_of_themis.py => tearsofthemis.py (100%) diff --git a/setting.py b/setting.py index 7497d00..579d63b 100644 --- a/setting.py +++ b/setting.py @@ -98,6 +98,12 @@ honkai3rd_Act_id = "ea20211026151532" honkai3rd_Is_signurl = web_Api + "/common/eutheniav2/index?act_id={}®ion={}&uid={}" honkai3rd_SignUrl = web_Api + "/common/eutheniav2/sign" +# 未定事件簿自动签到相关设置 +tearsofthemis_Act_id = "e202202251749321" +tearsofthemis_checkin_rewards = f'{web_Api}/event/luna/home?lang=zh-cn&act_id={tearsofthemis_Act_id}' +tearsofthemis_Is_signurl = honkai2_Is_signurl +tearsofthemis_Sign_url = honkai2_Sign_url # 和二崩完全一致 + # 原神自动签到相关的设置 genshin_Act_id = "e202009291139501" genshin_checkin_rewards = f'{web_Api}/event/bbs_sign_reward/home?act_id={genshin_Act_id}' diff --git a/tears_of_themis.py b/tearsofthemis.py similarity index 100% rename from tears_of_themis.py rename to tearsofthemis.py