This commit is contained in:
parent
c518a438f2
commit
3321ee2846
9
main.py
9
main.py
|
@ -57,7 +57,7 @@ class RunError(Exception):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if not os.environ.get("MHYY_DEBUG", False):
|
if not os.environ.get("MHYY_DEBUG", False):
|
||||||
wait_time = random.randint(1, 3600) # Random Sleep to Avoid Ban
|
wait_time = random.randint(1, 3600) # Random Sleep to Avoid Ban
|
||||||
print(f'为了避免同一时间签到人数太多导致被官方怀疑,开始休眠 {wait_time} 秒')
|
print(f"为了避免同一时间签到人数太多导致被官方怀疑,开始休眠 {wait_time} 秒")
|
||||||
time.sleep(wait_time)
|
time.sleep(wait_time)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -113,7 +113,8 @@ if __name__ == "__main__":
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0",
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0",
|
||||||
}
|
}
|
||||||
bbsid = re.findall(r"oi=[0-9]+", token)[0].replace("oi=", "")
|
bbsid = re.findall(r"oi=[0-9]+", token)[0].replace("oi=", "")
|
||||||
if config.get("region", "cn") == "os":
|
region = config.get("region", "cn")
|
||||||
|
if region == "os":
|
||||||
# 国际服处理
|
# 国际服处理
|
||||||
headers["x-rpc-channel"] = "mihoyo"
|
headers["x-rpc-channel"] = "mihoyo"
|
||||||
headers["x-rpc-cg_game_biz"] = "hk4e_global"
|
headers["x-rpc-cg_game_biz"] = "hk4e_global"
|
||||||
|
@ -129,6 +130,10 @@ if __name__ == "__main__":
|
||||||
)
|
)
|
||||||
AnnouncementURL = "https://sg-cg-api.hoyoverse.com/hk4e_global/cg/gamer/api/getAnnouncementInfo"
|
AnnouncementURL = "https://sg-cg-api.hoyoverse.com/hk4e_global/cg/gamer/api/getAnnouncementInfo"
|
||||||
|
|
||||||
|
print(
|
||||||
|
f"正在进行第 {conf.index(config) +1 } 个账号,服务器为{'CN' if region != 'os' else 'GLOBAL'}……"
|
||||||
|
)
|
||||||
|
|
||||||
wallet = httpx.get(WalletURL, headers=headers, timeout=60, verify=False)
|
wallet = httpx.get(WalletURL, headers=headers, timeout=60, verify=False)
|
||||||
print(wallet.text)
|
print(wallet.text)
|
||||||
if json.loads(wallet.text) == {
|
if json.loads(wallet.text) == {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user