for i in range(20):
challenge_pin = get_challenge_pin(url)
if challenge_pin is not None:
pin = challenge_pin + "test" + challenge_pin
try:
password = my_js_md5(s=pin)
get_login_cookie(url,password)
except:
print("get challenge pin failed ,please rerun !")
continue
else: # try当不报错 -> else
# 90s后关机
print('starting to shutdown PC after 90s!')
rst = runCommand(cmd)
# 关机
time.sleep(30)
turn_on_off(3,'off')