From f73b0bb89da4029f136fad938d5e008fd85aae1d Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Sat, 29 Jan 2022 14:21:24 +0800 Subject: [PATCH] =?UTF-8?q?Cookie=E5=A4=B1=E6=95=88=E7=9A=84=E5=B0=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genshin.py | 10 +++++++--- honkai3rd.py | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/genshin.py b/genshin.py index 03a3331..b480fb6 100644 --- a/genshin.py +++ b/genshin.py @@ -5,6 +5,7 @@ import random import setting from request import http from loghelper import log +from error import CookieError class Genshin: @@ -35,7 +36,9 @@ class Genshin: data = req.json() if data["retcode"] != 0: log.warning("获取账号列表失败!") - exit(1) + config.genshin_Auto_sign = False + config.save_config() + raise CookieError("BBS Cookie Errror") for i in data["data"]["list"]: temp_list.append([i["nickname"], i["game_uid"], i["region"]]) log.info(f"已获取到{len(temp_list)}个原神账号信息") @@ -49,7 +52,6 @@ class Genshin: if data["retcode"] != 0: log.warning("获取签到奖励列表失败") print(req.text) - exit(1) return data["data"]["awards"] # 判断签到 @@ -59,7 +61,9 @@ class Genshin: if data["retcode"] != 0: log.warning("获取账号签到信息失败!") print(req.text) - exit(1) + config.genshin_Auto_sign = False + config.save_config() + raise CookieError("BBS Cookie Errror") return data["data"] # 签到 diff --git a/honkai3rd.py b/honkai3rd.py index 675b087..7cd944e 100644 --- a/honkai3rd.py +++ b/honkai3rd.py @@ -5,6 +5,7 @@ import random import setting from request import http from loghelper import log +from error import CookieError class honkai3rd: @@ -36,7 +37,9 @@ class honkai3rd: data = req.json() if data["retcode"] != 0: log.warning("获取账号列表失败!") - exit(1) + config.honkai3rd_Auto_sign = False + config.save_config() + raise CookieError("BBS Cookie Errror") for i in data["data"]["list"]: temp_List.append([i["nickname"], i["game_uid"], i["region"]]) log.info(f"已获取到{len(temp_List)}个崩坏3账号信息")