From 312a26b84e23bf7bf46aef8d076d98648135b7bf Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 29 Aug 2024 11:48:23 +0800 Subject: [PATCH] let refresh ignore maxbot is paused, force to send refresh. --- chrome_tixcraft.py | 7 +++---- nodriver_tixcraft.py | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 9412aaa..b860353 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -10881,7 +10881,6 @@ def main(args): else: print("Load config error!") - # internal variable. 說明:這是一個內部變數,請略過。 url = "" last_url = "" @@ -10927,6 +10926,9 @@ def main(args): if len(url) == 0: continue + if not is_refresh_datetime_sent: + is_refresh_datetime_sent = check_refresh_datetime_occur(driver, config_dict["refresh_datetime"]) + is_maxbot_paused = False if os.path.exists(CONST_MAXBOT_INT28_FILE): is_maxbot_paused = True @@ -10952,9 +10954,6 @@ def main(args): driver = reset_webdriver(driver, config_dict, url) maxbot_last_reset_time = time.time() - if not is_refresh_datetime_sent: - is_refresh_datetime_sent = check_refresh_datetime_occur(driver, config_dict["refresh_datetime"]) - tixcraft_family = False if 'tixcraft.com' in url: tixcraft_family = True diff --git a/nodriver_tixcraft.py b/nodriver_tixcraft.py index 25931f0..128d669 100644 --- a/nodriver_tixcraft.py +++ b/nodriver_tixcraft.py @@ -2152,7 +2152,6 @@ def nodriver_overwrite_prefs(conf): with open(state_filepath, 'w') as outfile: outfile.write(json_str) - async def check_refresh_datetime_occur(tab, target_time): is_refresh_datetime_sent = False @@ -2168,7 +2167,6 @@ async def check_refresh_datetime_occur(tab, target_time): return is_refresh_datetime_sent - async def main(args): config_dict = get_config_dict(args) @@ -2195,7 +2193,6 @@ async def main(args): else: print("Load config error!") - # internal variable. 說明:這是一個內部變數,請略過。 url = "" last_url = "" @@ -2250,6 +2247,9 @@ async def main(args): if len(url) == 0: continue + if not is_refresh_datetime_sent: + is_refresh_datetime_sent = await check_refresh_datetime_occur(tab, config_dict["refresh_datetime"]) + is_maxbot_paused = False if os.path.exists(CONST_MAXBOT_INT28_FILE): is_maxbot_paused = True @@ -2269,9 +2269,6 @@ async def main(args): time.sleep(0.1) continue - if not is_refresh_datetime_sent: - is_refresh_datetime_sent = await check_refresh_datetime_occur(tab, config_dict["refresh_datetime"]) - # for kktix.cc and kktix.com if 'kktix.c' in url: is_quit_bot = await nodriver_kktix_main(tab, url, config_dict)