add time delay for galaxymacau.

master
CHUN YU YAO 2023-06-06 23:14:38 +08:00
parent 5a9e7fc873
commit fdf20ed223
3 changed files with 15 additions and 5 deletions

View File

@ -54,7 +54,7 @@ import itertools
import ssl import ssl
ssl._create_default_https_context = ssl._create_unverified_context ssl._create_default_https_context = ssl._create_unverified_context
CONST_APP_VERSION = u"MaxBot (2023.6.6)" CONST_APP_VERSION = u"MaxBot (2023.6.7)"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"
@ -8525,10 +8525,20 @@ def hkticketing_main(driver, url, config_dict, hkticketing_dict):
print("redirecting to url:", new_url) print("redirecting to url:", new_url)
try: try:
# web server is too busy to reponse. # web server is too busy to reponse.
driver.execute_script("retryIn=0;document.location.href = \"/default.aspx\";") driver.execute_script("document.location.href = \"/default.aspx\";")
except Exception as exc: except Exception as exc:
pass pass
try:
driver.get(new_url) driver.get(new_url)
except Exception as exc:
pass
# 刷太快, 會被封IP?
delay_second = config_dict["advanced"]["auto_reload_page_interval"]
if delay_second <= 4.0:
delay_second = 4.0
time.sleep(delay_second)
return hkticketing_dict return hkticketing_dict

View File

@ -22,7 +22,7 @@ import base64
import threading import threading
import subprocess import subprocess
CONST_APP_VERSION = u"MaxBot (2023.6.6)" CONST_APP_VERSION = u"MaxBot (2023.6.7)"
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"

View File

@ -25,7 +25,7 @@ import threading
import subprocess import subprocess
import json import json
CONST_APP_VERSION = u"MaxBot (2023.6.6)" CONST_APP_VERSION = u"MaxBot (2023.6.7)"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"