mirror of
https://github.com/TDSCDMAA/AutoMihoyoBBS.git
synced 2026-06-09 21:56:33 +08:00
log.warn -> log.warning
This commit is contained in:
parent
0ed27c85e7
commit
a0739be904
12
genshin.py
12
genshin.py
@ -33,7 +33,7 @@ class genshin:
|
||||
req = http.get(setting.genshin_Account_info_url, headers=self.headers)
|
||||
data = req.json()
|
||||
if data["retcode"] != 0:
|
||||
tools.log.warn("获取账号列表失败!")
|
||||
tools.log.warning("获取账号列表失败!")
|
||||
exit(1)
|
||||
for i in data["data"]["list"]:
|
||||
temp_List.append([i["nickname"], i["game_uid"], i["region"]])
|
||||
@ -46,7 +46,7 @@ class genshin:
|
||||
req = http.get(setting.genshin_Signlisturl.format(setting.genshin_Act_id), headers=self.headers)
|
||||
data = req.json()
|
||||
if data["retcode"] != 0:
|
||||
tools.log.warn("获取签到奖励列表失败")
|
||||
tools.log.warning("获取签到奖励列表失败")
|
||||
print(req.text)
|
||||
exit(1)
|
||||
return data["data"]["awards"]
|
||||
@ -56,7 +56,7 @@ class genshin:
|
||||
req = http.get(setting.genshin_Is_signurl.format(setting.genshin_Act_id, region, uid), headers=self.headers)
|
||||
data = req.json()
|
||||
if data["retcode"] != 0:
|
||||
tools.log.warn("获取账号签到信息失败!")
|
||||
tools.log.warning("获取账号签到信息失败!")
|
||||
print(req.text)
|
||||
exit(1)
|
||||
return data["data"]
|
||||
@ -69,7 +69,7 @@ class genshin:
|
||||
time.sleep(random.randint(2, 8))
|
||||
is_data = self.Is_sign(region=i[2], uid=i[1])
|
||||
if is_data["first_bind"]:
|
||||
tools.log.warn(f"旅行者{i[0]}是第一次绑定米游社,请先手动签到一次")
|
||||
tools.log.warning(f"旅行者{i[0]}是第一次绑定米游社,请先手动签到一次")
|
||||
else:
|
||||
sign_Days = is_data["total_sign_day"] - 1
|
||||
if is_data["is_sign"]:
|
||||
@ -88,7 +88,7 @@ class genshin:
|
||||
elif data["retcode"] == -5003:
|
||||
tools.log.info(f"旅行者{i[0]}今天已经签到过了~\r\n今天获得的奖励是{tools.Get_item(self.sign_Give[sign_Days])}")
|
||||
else:
|
||||
tools.log.warn("账号签到失败!")
|
||||
tools.log.warning("账号签到失败!")
|
||||
print(req.text)
|
||||
else:
|
||||
tools.log.warn("账号没有绑定任何原神账号!")
|
||||
tools.log.warning("账号没有绑定任何原神账号!")
|
||||
|
||||
10
honkai3rd.py
10
honkai3rd.py
@ -34,7 +34,7 @@ class honkai3rd:
|
||||
req = http.get(setting.honkai3rd_Account_info_url, headers=self.headers)
|
||||
data = req.json()
|
||||
if data["retcode"] != 0:
|
||||
tools.log.warn("获取账号列表失败!")
|
||||
tools.log.warning("获取账号列表失败!")
|
||||
exit(1)
|
||||
for i in data["data"]["list"]:
|
||||
temp_List.append([i["nickname"], i["game_uid"], i["region"]])
|
||||
@ -42,7 +42,7 @@ class honkai3rd:
|
||||
return temp_List
|
||||
|
||||
# 获取今天已经签到了的dict
|
||||
def Get_today_item(self, raw_data: list) -> dict:
|
||||
def Get_today_item(raw_data: list) -> dict:
|
||||
# 用range进行循环,当status等于0的时候上一个就是今天签到的dict
|
||||
for i in range(len(raw_data)):
|
||||
if raw_data[i]["status"] == 0:
|
||||
@ -57,7 +57,7 @@ class honkai3rd:
|
||||
req = http.get(setting.honkai3rd_Is_signurl.format(setting.honkai3rd_Act_id, region, uid), headers=self.headers)
|
||||
data = req.json()
|
||||
if data["retcode"] != 0:
|
||||
tools.log.warn("获取账号签到信息失败!")
|
||||
tools.log.warning("获取账号签到信息失败!")
|
||||
print(req.text)
|
||||
exit(1)
|
||||
today_Item = self.Get_today_item(data["data"]["sign"]["list"])
|
||||
@ -86,7 +86,7 @@ class honkai3rd:
|
||||
# 崩坏3应为奖励列表和签到信息在一起了,加上上面已经可以进行了一次判断,所以这里旧不重复再次执行判断来获取内容了
|
||||
tools.log.info(f"舰长{i[0]}今天已经签到过了~")
|
||||
else:
|
||||
tools.log.warn("账号签到失败!")
|
||||
tools.log.warning("账号签到失败!")
|
||||
print(req.text)
|
||||
else:
|
||||
tools.log.warn("账号没有绑定任何崩坏3账号!")
|
||||
tools.log.warning("账号没有绑定任何崩坏3账号!")
|
||||
|
||||
3
login.py
3
login.py
@ -5,11 +5,10 @@ import setting
|
||||
|
||||
|
||||
def login():
|
||||
if (config.mihoyobbs_Cookies == ''):
|
||||
if config.mihoyobbs_Cookies == '':
|
||||
log.error("请填入Cookies!")
|
||||
config.Clear_cookies()
|
||||
exit(1)
|
||||
temp_Cookies = {}
|
||||
# 判断Cookie里面是否有login_ticket 没有的话直接退了
|
||||
if "login_ticket" in config.mihoyobbs_Cookies:
|
||||
temp_Cookies = config.mihoyobbs_Cookies.split(";")
|
||||
|
||||
2
main.py
2
main.py
@ -73,7 +73,7 @@ def main():
|
||||
else:
|
||||
tools.log.info("崩坏3签到功能未启用!")
|
||||
else:
|
||||
tools.log.warn("Config未启用!")
|
||||
tools.log.warning("Config未启用!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@ -14,7 +14,7 @@ def Fund_config() -> list:
|
||||
for files in os.listdir(config.path):
|
||||
if os.path.splitext(files)[1] == '.json':
|
||||
file_Name.append(files)
|
||||
return (file_Name)
|
||||
return file_Name
|
||||
|
||||
|
||||
def main_multi(autorun: bool):
|
||||
@ -22,7 +22,7 @@ def main_multi(autorun: bool):
|
||||
tools.log.info("正在搜索配置文件!")
|
||||
config_List = Fund_config()
|
||||
if len(config_List) == 0:
|
||||
tools.log.warn("未检测到配置文件,请确认config文件夹存在.json后缀名的配置文件!")
|
||||
tools.log.warning("未检测到配置文件,请确认config文件夹存在.json后缀名的配置文件!")
|
||||
exit(1)
|
||||
if autorun:
|
||||
tools.log.info(f"已搜索到{len(config_List)}个配置文件,正在开始执行!")
|
||||
|
||||
@ -112,7 +112,7 @@ class mihoyobbs:
|
||||
else:
|
||||
tools.log.info("正在签到......")
|
||||
for i in setting.mihoyobbs_List_Use:
|
||||
req = http.post(url=setting.bbs_Signurl.format(i["id"]), data="", headers=self.headers)
|
||||
req = http.post(url=setting.bbs_Signurl.format(i["id"]), data={}, headers=self.headers)
|
||||
data = req.json()
|
||||
if "err" not in data["message"]:
|
||||
tools.log.info(str(i["name"] + data["message"]))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user