2024-04-23, add refrash at target time

master
Your Name 2024-08-25 17:31:16 +08:00
parent 7f5ca0ad4c
commit 9b0d32918f
11 changed files with 93 additions and 20 deletions

View File

@ -44,7 +44,7 @@ except Exception as exc:
print(exc) print(exc)
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.22)" CONST_APP_VERSION = "MaxBot (2024.04.23)"
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
@ -10851,6 +10851,20 @@ def resize_window(driver, config_dict):
driver.set_window_size(int(size_array[0]), int(size_array[1])) driver.set_window_size(int(size_array[0]), int(size_array[1]))
driver.set_window_position(position_left, 30) driver.set_window_position(position_left, 30)
def check_refresh_datetime_occur(driver, target_time):
is_refresh_datetime_sent = False
system_clock_data = datetime.now()
current_time = system_clock_data.strftime('%H:%M:%S')
if target_time == current_time:
try:
driver.refresh()
is_refresh_datetime_sent = True
print("send refresh at time:", current_time)
except Exception as exc:
pass
return is_refresh_datetime_sent
def main(args): def main(args):
config_dict = get_config_dict(args) config_dict = get_config_dict(args)
@ -10885,6 +10899,8 @@ def main(args):
maxbot_last_reset_time = time.time() maxbot_last_reset_time = time.time()
is_quit_bot = False is_quit_bot = False
is_refresh_datetime_sent = False
while True: while True:
time.sleep(0.05) time.sleep(0.05)
@ -10936,6 +10952,9 @@ def main(args):
driver = reset_webdriver(driver, config_dict, url) driver = reset_webdriver(driver, config_dict, url)
maxbot_last_reset_time = time.time() 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 tixcraft_family = False
if 'tixcraft.com' in url: if 'tixcraft.com' in url:
tixcraft_family = True tixcraft_family = True

View File

@ -24,7 +24,7 @@ import webbrowser
import util import util
CONST_APP_VERSION = "MaxBot (2024.04.22)" CONST_APP_VERSION = "MaxBot (2024.04.23)"
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

@ -1,11 +1,5 @@
# Demo (示範影片) # Demo (示範影片)
### 2024-04-14
網頁設定介面
https://youtu.be/VDQFbweMLxU
### 2024-04-11 ### 2024-04-11
信用卡活動登錄自動填身份證號碼 信用卡活動登錄自動填身份證號碼

View File

@ -32,7 +32,7 @@ except Exception as exc:
print(exc) print(exc)
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.22)" CONST_APP_VERSION = "MaxBot (2024.04.23)"
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
@ -2152,6 +2152,23 @@ def nodriver_overwrite_prefs(conf):
with open(state_filepath, 'w') as outfile: with open(state_filepath, 'w') as outfile:
outfile.write(json_str) outfile.write(json_str)
async def check_refresh_datetime_occur(tab, target_time):
is_refresh_datetime_sent = False
system_clock_data = datetime.now()
current_time = system_clock_data.strftime('%H:%M:%S')
if target_time == current_time:
try:
await tab.reload()
is_refresh_datetime_sent = True
print("send refresh at time:", current_time)
except Exception as exc:
pass
return is_refresh_datetime_sent
async def main(args): async def main(args):
config_dict = get_config_dict(args) config_dict = get_config_dict(args)
@ -2205,6 +2222,8 @@ async def main(args):
maxbot_last_reset_time = time.time() maxbot_last_reset_time = time.time()
is_quit_bot = False is_quit_bot = False
is_refresh_datetime_sent = False
while True: while True:
time.sleep(0.05) time.sleep(0.05)
@ -2250,6 +2269,9 @@ async def main(args):
time.sleep(0.1) time.sleep(0.1)
continue 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 # for kktix.cc and kktix.com
if 'kktix.c' in url: if 'kktix.c' in url:
is_quit_bot = await nodriver_kktix_main(tab, url, config_dict) is_quit_bot = await nodriver_kktix_main(tab, url, config_dict)

View File

@ -1,8 +1,9 @@
{ {
"homepage": "about:blank", "homepage": "about:blank",
"browser": "chrome", "browser": "chrome",
"language": "English", "language": "\u7e41\u9ad4\u4e2d\u6587",
"ticket_number": 2, "ticket_number": 2,
"refresh_datetime": "",
"ocr_captcha": { "ocr_captcha": {
"enable": true, "enable": true,
"beta": true, "beta": true,
@ -82,7 +83,7 @@
"remote_url": "\"http://127.0.0.1:16888/\"", "remote_url": "\"http://127.0.0.1:16888/\"",
"auto_reload_page_interval": 0.1, "auto_reload_page_interval": 0.1,
"auto_reload_overheat_count": 4, "auto_reload_overheat_count": 4,
"auto_reload_overheat_cd": 1, "auto_reload_overheat_cd": 1.0,
"reset_browser_interval": 0, "reset_browser_interval": 0,
"proxy_server_port": "", "proxy_server_port": "",
"window_size": "480,1024", "window_size": "480,1024",

View File

@ -39,7 +39,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.22)" CONST_APP_VERSION = "MaxBot (2024.04.23)"
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
@ -104,6 +104,8 @@ def get_default_config():
config_dict["browser"] = "chrome" config_dict["browser"] = "chrome"
config_dict["language"] = "English" config_dict["language"] = "English"
config_dict["ticket_number"] = 2 config_dict["ticket_number"] = 2
config_dict["refresh_datetime"] = ""
config_dict["ocr_captcha"] = {} config_dict["ocr_captcha"] = {}
config_dict["ocr_captcha"]["enable"] = True config_dict["ocr_captcha"]["enable"] = True
config_dict["ocr_captcha"]["beta"] = True config_dict["ocr_captcha"]["beta"] = True

View File

@ -34,7 +34,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.22)" CONST_APP_VERSION = "MaxBot (2024.04.23)"
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
@ -106,6 +106,7 @@ def load_translate():
en_us["browser"] = 'Browser' en_us["browser"] = 'Browser'
en_us["language"] = 'Language' en_us["language"] = 'Language'
en_us["ticket_number"] = 'Ticker Number' en_us["ticket_number"] = 'Ticker Number'
en_us["refresh_datetime"] = 'Refresh at specified time'
en_us["enable"] = 'Enable' en_us["enable"] = 'Enable'
en_us["recommand_enable"] = "Recommended to enable" en_us["recommand_enable"] = "Recommended to enable"
@ -226,6 +227,7 @@ def load_translate():
zh_tw["browser"] = '瀏覽器' zh_tw["browser"] = '瀏覽器'
zh_tw["language"] = '語言' zh_tw["language"] = '語言'
zh_tw["ticket_number"] = '門票張數' zh_tw["ticket_number"] = '門票張數'
zh_tw["refresh_datetime"] = '刷新在指定時間'
zh_tw["enable"] = '啟用' zh_tw["enable"] = '啟用'
zh_tw["recommand_enable"] = "建議啟用" zh_tw["recommand_enable"] = "建議啟用"
@ -344,6 +346,7 @@ def load_translate():
zh_cn["browser"] = '浏览器' zh_cn["browser"] = '浏览器'
zh_cn["language"] = '语言' zh_cn["language"] = '语言'
zh_cn["ticket_number"] = '门票张数' zh_cn["ticket_number"] = '门票张数'
zh_cn["refresh_datetime"] = '刷新在指定时间'
zh_cn["enable"] = '启用' zh_cn["enable"] = '启用'
zh_cn["recommand_enable"] = "建议启用" zh_cn["recommand_enable"] = "建议启用"
@ -464,6 +467,7 @@ def load_translate():
ja_jp["browser"] = 'ブラウザ' ja_jp["browser"] = 'ブラウザ'
ja_jp["language"] = '言語' ja_jp["language"] = '言語'
ja_jp["ticket_number"] = '枚数' ja_jp["ticket_number"] = '枚数'
ja_jp["refresh_datetime"] = '目標時間にリフレッシュ'
ja_jp["enable"] = '有効' ja_jp["enable"] = '有効'
ja_jp["recommand_enable"] = "有効化を推奨" ja_jp["recommand_enable"] = "有効化を推奨"
@ -591,6 +595,8 @@ def get_default_config():
config_dict["browser"] = "chrome" config_dict["browser"] = "chrome"
config_dict["language"] = "English" config_dict["language"] = "English"
config_dict["ticket_number"] = 2 config_dict["ticket_number"] = 2
config_dict["refresh_datetime"] = ""
config_dict["ocr_captcha"] = {} config_dict["ocr_captcha"] = {}
config_dict["ocr_captcha"]["enable"] = True config_dict["ocr_captcha"]["enable"] = True
config_dict["ocr_captcha"]["beta"] = True config_dict["ocr_captcha"]["beta"] = True
@ -1023,6 +1029,7 @@ def btn_save_act(slience_mode=False):
txt_resume_keyword_second.insert("1.0", config_dict["advanced"]["resume_keyword_second"].strip()) txt_resume_keyword_second.insert("1.0", config_dict["advanced"]["resume_keyword_second"].strip())
if is_all_data_correct: if is_all_data_correct:
config_dict["refresh_datetime"] = txt_refresh_datetime.get().strip()
config_dict["area_auto_select"]["enable"] = bool(chk_state_area_auto_select.get()) config_dict["area_auto_select"]["enable"] = bool(chk_state_area_auto_select.get())
config_dict["area_auto_select"]["mode"] = combo_area_auto_select_mode.get().strip() config_dict["area_auto_select"]["mode"] = combo_area_auto_select_mode.get().strip()
@ -1258,6 +1265,7 @@ def applyNewLanguage():
global lbl_browser global lbl_browser
global lbl_language global lbl_language
global lbl_ticket_number global lbl_ticket_number
global lbl_refresh_datetime
# for kktix # for kktix
global lbl_auto_press_next_step_button global lbl_auto_press_next_step_button
@ -1347,6 +1355,7 @@ def applyNewLanguage():
lbl_browser.config(text=translate[language_code]["browser"]) lbl_browser.config(text=translate[language_code]["browser"])
lbl_language.config(text=translate[language_code]["language"]) lbl_language.config(text=translate[language_code]["language"])
lbl_ticket_number.config(text=translate[language_code]["ticket_number"]) lbl_ticket_number.config(text=translate[language_code]["ticket_number"])
lbl_refresh_datetime.config(text=translate[language_code]["refresh_datetime"])
lbl_auto_press_next_step_button.config(text=translate[language_code]["auto_press_next_step_button"]) lbl_auto_press_next_step_button.config(text=translate[language_code]["auto_press_next_step_button"])
lbl_auto_fill_ticket_number.config(text=translate[language_code]["auto_fill_ticket_number"]) lbl_auto_fill_ticket_number.config(text=translate[language_code]["auto_fill_ticket_number"])
@ -1674,9 +1683,6 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
print("python version:", platform.python_version()) print("python version:", platform.python_version())
print("platform:", platform.platform()) print("platform:", platform.platform())
global lbl_homepage
global lbl_ticket_number
global lbl_kktix global lbl_kktix
global lbl_tixcraft global lbl_tixcraft
@ -1686,6 +1692,7 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
group_row_count = 0 group_row_count = 0
# first row need padding Y # first row need padding Y
global lbl_homepage
lbl_homepage = Label(frame_group_header, text=translate[language_code]['homepage']) lbl_homepage = Label(frame_group_header, text=translate[language_code]['homepage'])
lbl_homepage.grid(column=0, row=group_row_count, sticky = E) lbl_homepage.grid(column=0, row=group_row_count, sticky = E)
@ -1699,6 +1706,7 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
group_row_count+=1 group_row_count+=1
global lbl_ticket_number
lbl_ticket_number = Label(frame_group_header, text=translate[language_code]['ticket_number']) lbl_ticket_number = Label(frame_group_header, text=translate[language_code]['ticket_number'])
lbl_ticket_number.grid(column=0, row=group_row_count, sticky = E) lbl_ticket_number.grid(column=0, row=group_row_count, sticky = E)
@ -1719,6 +1727,17 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
frame_group_header.grid(column=0, row=row_count, sticky = W, padx=UI_PADDING_X) frame_group_header.grid(column=0, row=row_count, sticky = W, padx=UI_PADDING_X)
group_row_count+=1
global lbl_refresh_datetime
lbl_refresh_datetime = Label(frame_group_header, text=translate[language_code]['refresh_datetime'])
lbl_refresh_datetime.grid(column=0, row=group_row_count, sticky = E)
global txt_refresh_datetime
txt_refresh_datetime_value = StringVar(frame_group_header, value=str(config_dict["refresh_datetime"]))
txt_refresh_datetime = Entry(frame_group_header, width=30, textvariable = txt_refresh_datetime_value)
txt_refresh_datetime.grid(column=1, row=group_row_count, sticky = W)
row_count+=1 row_count+=1
# for sub group KKTix. # for sub group KKTix.
@ -3130,7 +3149,7 @@ def main_gui():
load_GUI(root, config_dict) load_GUI(root, config_dict)
GUI_SIZE_WIDTH = 590 GUI_SIZE_WIDTH = 610
GUI_SIZE_HEIGHT = 645 GUI_SIZE_HEIGHT = 645
GUI_SIZE_MACOS = str(GUI_SIZE_WIDTH) + 'x' + str(GUI_SIZE_HEIGHT) GUI_SIZE_MACOS = str(GUI_SIZE_WIDTH) + 'x' + str(GUI_SIZE_HEIGHT)

View File

@ -1 +1 @@
{"homepage": "about:blank", "browser": "chrome", "language": "English", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": true}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_sound": {"ticket": true, "order": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "facebook_password_plaintext": "", "kktix_password_plaintext": "", "fami_password_plaintext": "", "urbtix_password_plaintext": "", "cityline_password_plaintext": "", "hkticketing_password_plaintext": "", "kham_password_plaintext": "", "ticket_password_plaintext": "", "udn_password_plaintext": "", "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, "hide_some_image": false, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "remote_url": "\"http://127.0.0.1:16888/\"", "auto_reload_page_interval": 0.1, "auto_reload_overheat_count": 4, "auto_reload_overheat_cd": 1, "reset_browser_interval": 0, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}, "domain_filter": ["*.doubleclick.net/*", "*.googlesyndication.com/*", "*.ssp.hinet.net/*", "*a.amnet.tw/*", "*adx.c.appier.net/*", "*cdn.cookielaw.org/*", "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*", "*clarity.ms/*", "*cloudfront.com/*", "*cms.analytics.yahoo.com/*", "*e2elog.fetnet.net/*", "*fundingchoicesmessages.google.com/*", "*ghtinc.com/*", "*google-analytics.com/*", "*googletagmanager.com/*", "*googletagservices.com/*", "*img.uniicreative.com/*", "*lndata.com/*", "*match.adsrvr.org/*", "*onead.onevision.com.tw/*", "*play.google.com/log?*", "*popin.cc/*", "*rollbar.com/*", "*sb.scorecardresearch.com/*", "*tagtoo.co/*", "*ticketmaster.sg/js/adblock*", "*ticketmaster.sg/js/adblock.js*", "*tixcraft.com/js/analytics.js*", "*tixcraft.com/js/common.js*", "*tixcraft.com/js/custom.js*", "*treasuredata.com/*", "*www.youtube.com/youtubei/v1/player/heartbeat*"]} {"homepage": "about:blank", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "refresh_datetime": "", "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": true}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_sound": {"ticket": true, "order": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "facebook_password_plaintext": "", "kktix_password_plaintext": "", "fami_password_plaintext": "", "urbtix_password_plaintext": "", "cityline_password_plaintext": "", "hkticketing_password_plaintext": "", "kham_password_plaintext": "", "ticket_password_plaintext": "", "udn_password_plaintext": "", "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, "hide_some_image": false, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "remote_url": "\"http://127.0.0.1:16888/\"", "auto_reload_page_interval": 0.1, "auto_reload_overheat_count": 4, "auto_reload_overheat_cd": 1.0, "reset_browser_interval": 0, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}, "domain_filter": ["*.doubleclick.net/*", "*.googlesyndication.com/*", "*.ssp.hinet.net/*", "*a.amnet.tw/*", "*adx.c.appier.net/*", "*cdn.cookielaw.org/*", "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*", "*clarity.ms/*", "*cloudfront.com/*", "*cms.analytics.yahoo.com/*", "*e2elog.fetnet.net/*", "*fundingchoicesmessages.google.com/*", "*ghtinc.com/*", "*google-analytics.com/*", "*googletagmanager.com/*", "*googletagservices.com/*", "*img.uniicreative.com/*", "*lndata.com/*", "*match.adsrvr.org/*", "*onead.onevision.com.tw/*", "*play.google.com/log?*", "*popin.cc/*", "*rollbar.com/*", "*sb.scorecardresearch.com/*", "*tagtoo.co/*", "*ticketmaster.sg/js/adblock*", "*ticketmaster.sg/js/adblock.js*", "*tixcraft.com/js/analytics.js*", "*tixcraft.com/js/common.js*", "*tixcraft.com/js/custom.js*", "*treasuredata.com/*", "*www.youtube.com/youtubei/v1/player/heartbeat*"]}

View File

@ -1 +1 @@
{"homepage": "about:blank", "browser": "chrome", "language": "English", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": true}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_sound": {"ticket": true, "order": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "facebook_password_plaintext": "", "kktix_password_plaintext": "", "fami_password_plaintext": "", "urbtix_password_plaintext": "", "cityline_password_plaintext": "", "hkticketing_password_plaintext": "", "kham_password_plaintext": "", "ticket_password_plaintext": "", "udn_password_plaintext": "", "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, "hide_some_image": false, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "remote_url": "\"http://127.0.0.1:16888/\"", "auto_reload_page_interval": 0.1, "auto_reload_overheat_count": 4, "auto_reload_overheat_cd": 1, "reset_browser_interval": 0, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}} {"homepage": "about:blank", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "refresh_datetime": "", "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": true}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_sound": {"ticket": true, "order": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "facebook_password_plaintext": "", "kktix_password_plaintext": "", "fami_password_plaintext": "", "urbtix_password_plaintext": "", "cityline_password_plaintext": "", "hkticketing_password_plaintext": "", "kham_password_plaintext": "", "ticket_password_plaintext": "", "udn_password_plaintext": "", "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, "hide_some_image": false, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "remote_url": "\"http://127.0.0.1:16888/\"", "auto_reload_page_interval": 0.1, "auto_reload_overheat_count": 4, "auto_reload_overheat_cd": 1.0, "reset_browser_interval": 0, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}}

View File

@ -176,6 +176,19 @@
</select> </select>
</div> </div>
</div> </div>
<div class="row mb-3">
<label for="refresh_datetime" class="col-sm-2 col-form-label">刷新在指定時間</label>
<div class="col-sm-10">
<input class="form-control" id="refresh_datetime" value="" />
<div class="bd-callout bd-callout-info">
<strong>提示:</strong>
時間格式 <code>HH:MM:SS</code> (小時:分鐘:秒數)。在設定介面修改並存檔,並不會套用在「已經」開出的瀏覽器,只會套用在存檔之後按「搶票」所開出的瀏覽器。
</div>
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<label for="date_select_mode" class="col-sm-2 col-form-label">日期排序方式</label> <label for="date_select_mode" class="col-sm-2 col-form-label">日期排序方式</label>
<div class="col-sm-10"> <div class="col-sm-10">

View File

@ -10,6 +10,7 @@ const resume_button = document.querySelector('#resume_btn');
// preference // preference
const homepage = document.querySelector('#homepage'); const homepage = document.querySelector('#homepage');
const ticket_number = document.querySelector('#ticket_number'); const ticket_number = document.querySelector('#ticket_number');
const refresh_datetime = document.querySelector('#refresh_datetime');
const date_select_mode = document.querySelector('#date_select_mode'); const date_select_mode = document.querySelector('#date_select_mode');
const date_keyword = document.querySelector('#date_keyword'); const date_keyword = document.querySelector('#date_keyword');
const area_select_mode = document.querySelector('#area_select_mode'); const area_select_mode = document.querySelector('#area_select_mode');
@ -95,6 +96,7 @@ function load_settins_to_form(settings)
// preference // preference
homepage.value = settings.homepage; homepage.value = settings.homepage;
ticket_number.value = settings.ticket_number; ticket_number.value = settings.ticket_number;
refresh_datetime.value = settings.refresh_datetime;
date_select_mode.value = settings.date_auto_select.mode; date_select_mode.value = settings.date_auto_select.mode;
date_keyword.value = settings.date_auto_select.date_keyword; date_keyword.value = settings.date_auto_select.date_keyword;
if(date_keyword.value=='""') { if(date_keyword.value=='""') {
@ -328,6 +330,7 @@ function save_changes_to_dict(silent_flag)
// preference // preference
settings.homepage = homepage.value; settings.homepage = homepage.value;
settings.ticket_number = ticket_number_value; settings.ticket_number = ticket_number_value;
settings.refresh_datetime = refresh_datetime.value;
settings.date_auto_select.mode = date_select_mode.value; settings.date_auto_select.mode = date_select_mode.value;
let date_keyword_string = date_keyword.value; let date_keyword_string = date_keyword.value;
@ -507,7 +510,7 @@ function maxbot_save()
function check_unsaved_fields() function check_unsaved_fields()
{ {
if(settings) { if(settings) {
const field_list_basic = ["homepage","ticket_number","browser","webdriver_type"]; const field_list_basic = ["homepage","ticket_number","refresh_datetime","browser","webdriver_type"];
field_list_basic.forEach(f => { field_list_basic.forEach(f => {
const field = document.querySelector('#'+f); const field = document.querySelector('#'+f);
if(field.value != settings[f]) { if(field.value != settings[f]) {