Cookie失效的小修改

This commit is contained in:
Womsxd 2022-01-29 14:21:24 +08:00
parent 47280f1124
commit f73b0bb89d
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
2 changed files with 11 additions and 4 deletions

View File

@ -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"]
# 签到

View File

@ -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账号信息")