|
|
@ -230,17 +230,19 @@ async def lock_ticket(day, seats):
|
|
|
|
# cookie
|
|
|
|
# cookie
|
|
|
|
def update_cookie():
|
|
|
|
def update_cookie():
|
|
|
|
global COOKIE, USERNAME, PASSWORD, HEADLESS
|
|
|
|
global COOKIE, USERNAME, PASSWORD, HEADLESS
|
|
|
|
|
|
|
|
for i in range(5):
|
|
|
|
COOKIE = get_cookie(USERNAME, PASSWORD, HEADLESS)
|
|
|
|
COOKIE = get_cookie(USERNAME, PASSWORD, HEADLESS)
|
|
|
|
if not COOKIE:
|
|
|
|
if COOKIE:
|
|
|
|
logger.critical("登陆失败,无法获取 cookie!")
|
|
|
|
|
|
|
|
os.system("pause")
|
|
|
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
config = configparser.ConfigParser(interpolation=None)
|
|
|
|
config = configparser.ConfigParser(interpolation=None)
|
|
|
|
config.read("./conf.ini", encoding="utf8")
|
|
|
|
config.read("./conf.ini", encoding="utf8")
|
|
|
|
config.set("conf", "cookie", COOKIE)
|
|
|
|
config.set("conf", "cookie", COOKIE)
|
|
|
|
with open("./conf.ini", 'w', encoding="utf8") as f:
|
|
|
|
with open("./conf.ini", 'w', encoding="utf8") as f:
|
|
|
|
config.write(f)
|
|
|
|
config.write(f)
|
|
|
|
logger.info("cookie 更新成功!")
|
|
|
|
logger.info("cookie 更新成功!")
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
logger.critical("登陆失败,无法获取 cookie!")
|
|
|
|
|
|
|
|
os.system("pause")
|
|
|
|
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|