变量名修改&Setting修改
This commit is contained in:
parent
cdc9172257
commit
b31fffb91c
22
genshin.py
22
genshin.py
@ -17,14 +17,14 @@ class Genshin:
|
||||
f'&act_id={setting.genshin_Act_id}&utm_source=bbs&utm_medium=mys&utm_campaign=icon'
|
||||
self.headers['Cookie'] = config.config["account"]["cookie"]
|
||||
self.headers['x-rpc-device_id'] = tools.get_device_id()
|
||||
self.acc_List = get_account_list("hk4e_cn", self.headers)
|
||||
if len(self.acc_List) != 0:
|
||||
self.sign_Give = self.get_signgive()
|
||||
self.account_list = get_account_list("hk4e_cn", self.headers)
|
||||
if len(self.account_list) != 0:
|
||||
self.checkin_rewards = self.get_checkin_rewards()
|
||||
|
||||
# 获取已经签到奖励列表
|
||||
def get_signgive(self) -> list:
|
||||
def get_checkin_rewards(self) -> list:
|
||||
log.info("正在获取签到奖励列表...")
|
||||
req = http.get(setting.genshin_Signlisturl.format(setting.genshin_Act_id), headers=self.headers)
|
||||
req = http.get(setting.genshin_checkin_rewards, headers=self.headers)
|
||||
data = req.json()
|
||||
if data["retcode"] != 0:
|
||||
log.warning("获取签到奖励列表失败")
|
||||
@ -46,8 +46,8 @@ class Genshin:
|
||||
# 签到
|
||||
def sign_account(self) -> str:
|
||||
return_data = "原神: "
|
||||
if len(self.acc_List) != 0:
|
||||
for i in self.acc_List:
|
||||
if len(self.account_list) != 0:
|
||||
for i in self.account_list:
|
||||
if i[1] in config.config["games"]["cn"]["genshin"]["black_list"]:
|
||||
continue
|
||||
log.info(f"正在为旅行者{i[0]}进行签到...")
|
||||
@ -59,7 +59,7 @@ class Genshin:
|
||||
sign_days = is_data["total_sign_day"] - 1
|
||||
ok = True
|
||||
if is_data["is_sign"]:
|
||||
log.info(f"旅行者{i[0]}今天已经签到过了~\r\n今天获得的奖励是{tools.get_item(self.sign_Give[sign_days])}")
|
||||
log.info(f"旅行者{i[0]}今天已经签到过了~\r\n今天获得的奖励是{tools.get_item(self.checkin_rewards[sign_days])}")
|
||||
sign_days += 1
|
||||
else:
|
||||
time.sleep(random.randint(2, 8))
|
||||
@ -68,15 +68,15 @@ class Genshin:
|
||||
data = req.json()
|
||||
if data["retcode"] == 0:
|
||||
log.info(f"旅行者{i[0]}签到成功~\r\n今天获得的奖励是"
|
||||
f"{tools.get_item(self.sign_Give[0 if sign_days == 0 else sign_days + 1])}")
|
||||
f"{tools.get_item(self.checkin_rewards[0 if sign_days == 0 else sign_days + 1])}")
|
||||
sign_days += 2
|
||||
elif data["retcode"] == -5003:
|
||||
log.info(f"旅行者{i[0]}今天已经签到过了~\r\n今天获得的奖励是{tools.get_item(self.sign_Give[sign_days])}")
|
||||
log.info(f"旅行者{i[0]}今天已经签到过了~\r\n今天获得的奖励是{tools.get_item(self.checkin_rewards[sign_days])}")
|
||||
else:
|
||||
log.warning("账号签到失败!")
|
||||
ok = False
|
||||
if ok:
|
||||
return_data += f"\n{i[0]}已连续签到{sign_days}天\n今天获得的奖励是{tools.get_item(self.sign_Give[sign_days-1])}"
|
||||
return_data += f"\n{i[0]}已连续签到{sign_days}天\n今天获得的奖励是{tools.get_item(self.checkin_rewards[sign_days - 1])}"
|
||||
else:
|
||||
return_data += f"\n{i[0]},本次签到失败"
|
||||
else:
|
||||
|
@ -17,7 +17,7 @@ class Honkai3rd:
|
||||
f'{setting.honkai3rd_Act_id}&utm_source=bbs&utm_medium=mys&utm_campaign=icon'
|
||||
self.headers['Cookie'] = config.config["account"]["cookie"]
|
||||
self.headers['x-rpc-device_id'] = tools.get_device_id()
|
||||
self.acc_List = get_account_list("bh3_cn", self.headers)
|
||||
self.account_list = get_account_list("bh3_cn", self.headers)
|
||||
self.sign_day = 0
|
||||
|
||||
# 获取今天已经签到了的dict
|
||||
@ -36,11 +36,11 @@ class Honkai3rd:
|
||||
# 签到
|
||||
def sign_account(self) -> str:
|
||||
return_data = "崩坏3: "
|
||||
if len(self.acc_List) == 0:
|
||||
if len(self.account_list) == 0:
|
||||
log.warning("账号没有绑定任何崩坏3账号!")
|
||||
return_data += "\n并没有绑定任何崩坏3账号"
|
||||
else:
|
||||
for i in self.acc_List:
|
||||
for i in self.account_list:
|
||||
if i[1] in config.config["games"]["cn"]["honkai3rd"]["black_list"]:
|
||||
continue
|
||||
log.info(f"正在为舰长 {i[0]} 进行签到...")
|
||||
|
@ -84,19 +84,17 @@ bbs_Like_url = bbs_Api + "/apihub/sapi/upvotePost" # post json
|
||||
|
||||
# 崩坏2自动签到相关的相关设置
|
||||
honkai2_Act_id = "e202203291431091"
|
||||
honkai2_Account_info_url = account_Info_url + "bh2_cn" # 废弃字段,之后可能会删除
|
||||
honkai2_checkin_rewards = f'{web_Api}/event/luna/home?lang=zh-cn&act_id={honkai2_Act_id}'
|
||||
honkai2_Is_signurl = web_Api + "/event/luna/info?lang=zh-cn&act_id={}®ion={}&uid={}"
|
||||
honkai2_Sign_url = web_Api + "/event/luna/sign"
|
||||
|
||||
# 崩坏3自动签到相关的设置
|
||||
honkai3rd_Act_id = "ea20211026151532"
|
||||
honkai3rd_Account_info_url = account_Info_url + "bh3_cn" # 废弃字段,之后可能会删除
|
||||
honkai3rd_Is_signurl = web_Api + "/common/eutheniav2/index?act_id={}®ion={}&uid={}"
|
||||
honkai3rd_SignUrl = web_Api + "/common/eutheniav2/sign"
|
||||
|
||||
# 原神自动签到相关的设置
|
||||
genshin_Act_id = "e202009291139501"
|
||||
genshin_Account_info_url = account_Info_url + "hk4e_cn" # 废弃字段,之后可能会删除
|
||||
genshin_Signlisturl = web_Api + "/event/bbs_sign_reward/home?act_id={}"
|
||||
genshin_checkin_rewards = f'{web_Api}/event/bbs_sign_reward/home?act_id={genshin_Act_id}'
|
||||
genshin_Is_signurl = web_Api + "/event/bbs_sign_reward/info?act_id={}®ion={}&uid={}"
|
||||
genshin_Signurl = web_Api + "/event/bbs_sign_reward/sign"
|
||||
|
Loading…
Reference in New Issue
Block a user