2023-12-28,update for kktix

master
unknown 2024-01-08 10:32:17 +08:00
parent d7417818aa
commit 01c776a1da
8 changed files with 92 additions and 110 deletions

View File

@ -54,7 +54,7 @@ import webbrowser
import chromedriver_autoinstaller import chromedriver_autoinstaller
CONST_APP_VERSION = "MaxBot (2023.12.27)" CONST_APP_VERSION = "MaxBot (2023.12.28)"
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"
@ -1856,8 +1856,8 @@ def tixcraft_date_auto_select(driver, url, config_dict, domain_name):
show_debug_message = True show_debug_message = True
# read config. # read config.
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"] pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"]
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
@ -2090,8 +2090,8 @@ def ticketmaster_date_auto_select(driver, url, config_dict, domain_name):
show_debug_message = True show_debug_message = True
# read config. # read config.
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
# TODO: implement this feature. # TODO: implement this feature.
date_keyword_and = "" date_keyword_and = ""
pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"] pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"]
@ -3912,11 +3912,12 @@ def kktix_check_agree_checkbox(driver, config_dict):
if config_dict["advanced"]["verbose"]: if config_dict["advanced"]["verbose"]:
show_debug_message = True show_debug_message = True
is_need_refresh = False
is_finish_checkbox_click = False is_finish_checkbox_click = False
agree_label = None
agree_checkbox = None agree_checkbox = None
try: try:
agree_label = driver.find_element(By.CSS_SELECTOR, 'label[for="person_agree_terms"]')
agree_checkbox = driver.find_element(By.CSS_SELECTOR, '#person_agree_terms') agree_checkbox = driver.find_element(By.CSS_SELECTOR, '#person_agree_terms')
except Exception as exc: except Exception as exc:
print("find person_agree_terms checkbox Exception") print("find person_agree_terms checkbox Exception")
@ -3924,15 +3925,24 @@ def kktix_check_agree_checkbox(driver, config_dict):
print(exc) print(exc)
pass pass
if not agree_checkbox is None: is_dom_ready = False
is_need_refresh = False
if not agree_checkbox is None and not agree_label is None:
checkbox_html = ""
try:
checkbox_html = agree_label.get_attribute('innerHTML').strip()
#print("agree_checkbox html:", checkbox_html)
if len(checkbox_html) > 0:
if not "{{'new.i_read_and_agree_to'" in checkbox_html:
is_dom_ready = True
except Exception as e:
#print(e)
pass
is_finish_checkbox_click = force_check_checkbox(driver, agree_checkbox) is_finish_checkbox_click = force_check_checkbox(driver, agree_checkbox)
else:
is_need_refresh = True
if is_need_refresh: #print("status:", is_dom_ready, is_finish_checkbox_click)
print("find person_agree_terms checkbox fail, do refresh page.") return is_dom_ready, is_finish_checkbox_click
return is_need_refresh, is_finish_checkbox_click
def check_checkbox(driver, by, query): def check_checkbox(driver, by, query):
show_debug_message = True # debug. show_debug_message = True # debug.
@ -4669,6 +4679,7 @@ let reload=false;
console.log(data.inventory.registerStatus); console.log(data.inventory.registerStatus);
if(data.inventory.registerStatus=='OUT_OF_STOCK') {reload=true;} if(data.inventory.registerStatus=='OUT_OF_STOCK') {reload=true;}
if(data.inventory.registerStatus=='COMING_SOON') {reload=true;} if(data.inventory.registerStatus=='COMING_SOON') {reload=true;}
if(data.inventory.registerStatus=='SOLD_OUT') {reload=true;}
console.log(reload); console.log(reload);
if(reload) {location.reload();} if(reload) {location.reload();}
} }
@ -4695,45 +4706,18 @@ if (typeof $.kkUser.checked_status_register_code === 'undefined') {
registerStatus = None registerStatus = None
if is_match_event_code: if is_match_event_code:
registerStatus = kktix_get_registerStatus(driver, event_code) kktix_get_registerStatus(driver, event_code)
return registerStatus return registerStatus
def kktix_reg_auto_reload(driver, url, config_dict, kktix_register_status_last): def kktix_reg_auto_reload(driver, url, config_dict):
registerStatus = kktix_register_status_last
# auto reload javascrit code at chrome extension. # auto reload javascrit code at chrome extension.
is_need_refresh = False
if config_dict["browser"] in ["firefox", "edge", "safari"]: if config_dict["browser"] in ["firefox", "edge", "safari"]:
if not is_need_refresh: kktix_check_register_status(driver, url)
if registerStatus is None:
# current version, change refresh event from selenium to javascript.
registerStatus = kktix_check_register_status(driver, url)
# for request solution, refresh on selenium.
if not registerStatus is None:
print("registerStatus:", registerStatus)
# OUT_OF_STOCK
if registerStatus != 'IN_STOCK':
is_need_refresh = True
is_finish_checkbox_click = False is_finish_checkbox_click = False
if not is_need_refresh: is_dom_ready, is_finish_checkbox_click = kktix_check_agree_checkbox(driver, config_dict)
is_need_refresh, is_finish_checkbox_click = kktix_check_agree_checkbox(driver, config_dict)
if not is_finish_checkbox_click:
# retry again.
is_need_refresh, is_finish_checkbox_click = kktix_check_agree_checkbox(driver, config_dict)
if is_need_refresh: return is_dom_ready, is_finish_checkbox_click
try:
print("try to refresh page...")
driver.refresh()
except Exception as exc:
#print("refresh fail")
pass
if config_dict["advanced"]["auto_reload_random_delay"]:
time.sleep(random.randint(0,CONST_AUTO_RELOAD_RANDOM_DELAY_MAX_SECOND))
return is_need_refresh, is_finish_checkbox_click
# PURPOSE: get target area list. # PURPOSE: get target area list.
@ -4745,7 +4729,7 @@ def get_fami_target_area(driver, config_dict, area_keyword_item):
if config_dict["advanced"]["verbose"]: if config_dict["advanced"]["verbose"]:
show_debug_message = True show_debug_message = True
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
date_keyword = format_keyword_string(date_keyword) date_keyword = format_keyword_string(date_keyword)
auto_select_mode = config_dict["area_auto_select"]["mode"] auto_select_mode = config_dict["area_auto_select"]["mode"]
@ -4962,8 +4946,8 @@ def fami_date_auto_select(driver, config_dict, last_activity_url):
if config_dict["advanced"]["verbose"]: if config_dict["advanced"]["verbose"]:
show_debug_message = True show_debug_message = True
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
if show_debug_message: if show_debug_message:
@ -5583,8 +5567,8 @@ def urbtix_purchase_ticket(driver, config_dict):
show_debug_message = True # debug. show_debug_message = True # debug.
show_debug_message = False # online show_debug_message = False # online
date_auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] date_auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
if show_debug_message: if show_debug_message:
@ -6336,8 +6320,8 @@ def cityline_purchase_button_press(driver, config_dict):
show_debug_message = True show_debug_message = True
date_auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] date_auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
if show_debug_message: if show_debug_message:
@ -6462,8 +6446,8 @@ def ibon_date_auto_select(driver, config_dict):
if config_dict["advanced"]["verbose"]: if config_dict["advanced"]["verbose"]:
show_debug_message = True show_debug_message = True
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
if show_debug_message: if show_debug_message:
@ -7631,14 +7615,14 @@ def tixcraft_main(driver, url, config_dict, tixcraft_dict, ocr, Captcha_Browser)
is_date_selected = False is_date_selected = False
if "/activity/game/" in url: if "/activity/game/" in url:
tixcraft_dict["start_time"] = time.time() tixcraft_dict["start_time"] = time.time()
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
domain_name = url.split('/')[2] domain_name = url.split('/')[2]
is_date_selected = tixcraft_date_auto_select(driver, url, config_dict, domain_name) is_date_selected = tixcraft_date_auto_select(driver, url, config_dict, domain_name)
if '/artist/' in url and 'ticketmaster.com' in url: if '/artist/' in url and 'ticketmaster.com' in url:
tixcraft_dict["start_time"] = time.time() tixcraft_dict["start_time"] = time.time()
if len(url.split('/'))==6: if len(url.split('/'))==6:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
domain_name = url.split('/')[2] domain_name = url.split('/')[2]
is_date_selected = ticketmaster_date_auto_select(driver, url, config_dict, domain_name) is_date_selected = ticketmaster_date_auto_select(driver, url, config_dict, domain_name)
@ -7747,20 +7731,21 @@ def kktix_main(driver, url, config_dict, kktix_dict):
if not is_url_contain_sign_in: if not is_url_contain_sign_in:
if '/registrations/new' in url: if '/registrations/new' in url:
kktix_dict["start_time"] = time.time() kktix_dict["start_time"] = time.time()
is_need_refresh = False
is_finish_checkbox_click = False
is_need_refresh, is_finish_checkbox_click = kktix_reg_auto_reload(driver, url, config_dict, kktix_dict["kktix_register_status_last"])
if is_need_refresh: is_dom_ready = False
is_finish_checkbox_click = False
is_dom_ready, is_finish_checkbox_click = kktix_reg_auto_reload(driver, url, config_dict)
if not is_dom_ready:
# reset answer fail list. # reset answer fail list.
kktix_dict["fail_list"] = [] kktix_dict["fail_list"] = []
kktix_dict["captcha_sound_played"] = False kktix_dict["captcha_sound_played"] = False
kktix_dict["kktix_register_status_last"] = None
else: else:
# check is able to buy. # check is able to buy.
if config_dict["kktix"]["auto_fill_ticket_number"]: if config_dict["kktix"]["auto_fill_ticket_number"]:
kktix_dict["fail_list"], kktix_dict["captcha_sound_played"] = kktix_reg_new_main(driver, config_dict, kktix_dict["fail_list"], kktix_dict["captcha_sound_played"], is_finish_checkbox_click) kktix_dict["fail_list"], kktix_dict["captcha_sound_played"] = kktix_reg_new_main(driver, config_dict, kktix_dict["fail_list"], kktix_dict["captcha_sound_played"], is_finish_checkbox_click)
kktix_dict["done_time"] = time.time() kktix_dict["done_time"] = time.time()
else: else:
is_event_page = False is_event_page = False
if '/events/' in url: if '/events/' in url:
@ -7777,15 +7762,15 @@ def kktix_main(driver, url, config_dict, kktix_dict):
# reset answer fail list. # reset answer fail list.
kktix_dict["fail_list"] = [] kktix_dict["fail_list"] = []
kktix_dict["captcha_sound_played"] = False kktix_dict["captcha_sound_played"] = False
kktix_dict["kktix_register_status_last"] = None
if '/events/' in url and '/registrations/' in url and "-" in url: if '/events/' in url and '/registrations/' in url and "-" in url:
if not kktix_dict["start_time"] is None: if not '/registrations/new' in url:
if not kktix_dict["done_time"] is None: if not kktix_dict["start_time"] is None:
bot_elapsed_time = kktix_dict["done_time"] - kktix_dict["start_time"] if not kktix_dict["done_time"] is None:
if kktix_dict["elapsed_time"] != bot_elapsed_time: bot_elapsed_time = kktix_dict["done_time"] - kktix_dict["start_time"]
print("bot elapsed time:", "{:.3f}".format(bot_elapsed_time)) if kktix_dict["elapsed_time"] != bot_elapsed_time:
kktix_dict["elapsed_time"] = bot_elapsed_time print("bot elapsed time:", "{:.3f}".format(bot_elapsed_time))
kktix_dict["elapsed_time"] = bot_elapsed_time
if config_dict["advanced"]["headless"]: if config_dict["advanced"]["headless"]:
if not kktix_dict["is_popup_checkout"]: if not kktix_dict["is_popup_checkout"]:
@ -7828,7 +7813,7 @@ def famiticket_main(driver, url, config_dict, fami_dict):
fami_dict["fail_list"] = [] fami_dict["fail_list"] = []
if '/Sales/Home/Index/' in url: if '/Sales/Home/Index/' in url:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
is_date_assign_by_bot = fami_home_auto_select(driver, config_dict, fami_dict["last_activity"]) is_date_assign_by_bot = fami_home_auto_select(driver, config_dict, fami_dict["last_activity"])
return fami_dict return fami_dict
@ -8184,7 +8169,7 @@ def urbtix_main(driver, url, config_dict):
# https://www.urbtix.hk/event-detail/00000/ # https://www.urbtix.hk/event-detail/00000/
if '/event-detail/' in url: if '/event-detail/' in url:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
is_event_page = False is_event_page = False
if len(url.split('/'))<=6: if len(url.split('/'))<=6:
is_event_page = True is_event_page = True
@ -8349,7 +8334,7 @@ def cityline_main(driver, url, config_dict):
if is_modal_dialog_popup: if is_modal_dialog_popup:
print("is_modal_dialog_popup! skip...") print("is_modal_dialog_popup! skip...")
else: else:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
cityline_purchase_button_press(driver, config_dict) cityline_purchase_button_press(driver, config_dict)
if '/performance?' in url: if '/performance?' in url:
@ -8705,7 +8690,7 @@ def ibon_main(driver, url, config_dict, ibon_dict, ocr, Captcha_Browser):
is_event_page = True is_event_page = True
if is_event_page: if is_event_page:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
is_match_target_feature = True is_match_target_feature = True
is_date_assign_by_bot = ibon_date_auto_select(driver, config_dict) is_date_assign_by_bot = ibon_date_auto_select(driver, config_dict)
@ -8936,8 +8921,8 @@ def hkticketing_date_assign(driver, config_dict):
if config_dict["advanced"]["verbose"]: if config_dict["advanced"]["verbose"]:
show_debug_message = True show_debug_message = True
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
if show_debug_message: if show_debug_message:
print("date_keyword:", date_keyword) print("date_keyword:", date_keyword)
@ -9791,7 +9776,7 @@ def softix_powerweb_main(driver, url, config_dict, hkticketing_dict):
is_event_page = True is_event_page = True
if is_event_page: if is_event_page:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
if not hkticketing_dict["is_date_submiting"]: if not hkticketing_dict["is_date_submiting"]:
hkticketing_dict["is_date_submiting"], hkticketing_dict["fail_list"] = hkticketing_date_auto_select(driver, config_dict, hkticketing_dict["fail_list"]) hkticketing_dict["is_date_submiting"], hkticketing_dict["fail_list"] = hkticketing_date_auto_select(driver, config_dict, hkticketing_dict["fail_list"])
pass pass
@ -9844,8 +9829,8 @@ def hkam_date_auto_select(driver, domain_name, config_dict):
if config_dict["advanced"]["verbose"]: if config_dict["advanced"]["verbose"]:
show_debug_message = True show_debug_message = True
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
if show_debug_message: if show_debug_message:
@ -10703,11 +10688,11 @@ def kham_main(driver, url, config_dict, ocr, Captcha_Browser):
is_event_page = True is_event_page = True
if is_event_page: if is_event_page:
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
kham_product(driver, domain_name, config_dict) kham_product(driver, domain_name, config_dict)
if '/application/utk01/utk0101_.aspx' in url.lower(): if '/application/utk01/utk0101_.aspx' in url.lower():
date_auto_select_enable = config_dict["tixcraft"]["date_auto_select"]["enable"] date_auto_select_enable = config_dict["date_auto_select"]["enable"]
if date_auto_select_enable: if date_auto_select_enable:
kham_product(driver, domain_name, config_dict) kham_product(driver, domain_name, config_dict)
@ -10748,7 +10733,7 @@ def kham_main(driver, url, config_dict, ocr, Captcha_Browser):
is_button_clicked = force_press_button(driver, By.CSS_SELECTOR,'#buttonNext') is_button_clicked = force_press_button(driver, By.CSS_SELECTOR,'#buttonNext')
else: else:
# layout format #2 # layout format #2
date_auto_select_enable = config_dict["tixcraft"]["date_auto_select"]["enable"] date_auto_select_enable = config_dict["date_auto_select"]["enable"]
if date_auto_select_enable: if date_auto_select_enable:
kham_product(driver, domain_name, config_dict) kham_product(driver, domain_name, config_dict)
@ -10910,8 +10895,8 @@ def ticketplus_date_auto_select(driver, config_dict):
show_debug_message = True show_debug_message = True
# read config. # read config.
auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_select_mode = config_dict["date_auto_select"]["mode"]
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["date_auto_select"]["date_keyword"].strip()
# TODO: implement this feature. # TODO: implement this feature.
date_keyword_and = "" date_keyword_and = ""
pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"] pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"]
@ -12098,7 +12083,7 @@ def ticketplus_main(driver, url, config_dict, ocr, Captcha_Browser, ticketplus_d
is_button_pressed = ticketplus_accept_other_activity(driver) is_button_pressed = ticketplus_accept_other_activity(driver)
#print("is accept button pressed:", is_button_pressed) #print("is accept button pressed:", is_button_pressed)
if config_dict["tixcraft"]["date_auto_select"]["enable"]: if config_dict["date_auto_select"]["enable"]:
ticketplus_date_auto_select(driver, config_dict) ticketplus_date_auto_select(driver, config_dict)
#https://ticketplus.com.tw/order/XXX/OOO #https://ticketplus.com.tw/order/XXX/OOO
@ -12262,7 +12247,6 @@ def main(args):
kktix_dict = {} kktix_dict = {}
kktix_dict["fail_list"]=[] kktix_dict["fail_list"]=[]
kktix_dict["captcha_sound_played"] = False kktix_dict["captcha_sound_played"] = False
kktix_dict["kktix_register_status_last"] = None
kktix_dict["start_time"]=None kktix_dict["start_time"]=None
kktix_dict["done_time"]=None kktix_dict["done_time"]=None
kktix_dict["elapsed_time"]=None kktix_dict["elapsed_time"]=None

View File

@ -22,7 +22,7 @@ import sys
import threading import threading
import webbrowser import webbrowser
CONST_APP_VERSION = "MaxBot (2023.12.27)" CONST_APP_VERSION = "MaxBot (2023.12.28)"
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 +1 @@
{"homepage": "https://tixcraft.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true}, "tixcraft": {"date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "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\"", "advanced": {"play_captcha_sound": {"enable": 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": "", "adblock_plus_enable": false, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "online_dictionary_url": "", "auto_reload_page_interval": 1.0, "auto_reload_random_delay": false, "proxy_server_port": ""}} {"homepage": "https://kktix.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "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}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_captcha_sound": {"enable": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "weng.32002@gmail.com", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "eXlme2omX3Nq", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "adblock_plus_enable": false, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "online_dictionary_url": "", "auto_reload_page_interval": 1.0, "auto_reload_random_delay": false, "proxy_server_port": ""}}

View File

@ -34,7 +34,7 @@ import ssl
ssl._create_default_https_context = ssl._create_unverified_context ssl._create_default_https_context = ssl._create_unverified_context
CONST_APP_VERSION = "MaxBot (2023.12.27)" CONST_APP_VERSION = "MaxBot (2023.12.28)"
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"
@ -636,15 +636,10 @@ def get_default_config():
config_dict["ocr_captcha"]["enable"] = False config_dict["ocr_captcha"]["enable"] = False
config_dict["ocr_captcha"]["force_submit"] = False config_dict["ocr_captcha"]["force_submit"] = False
config_dict['kktix']={} config_dict["date_auto_select"] = {}
config_dict["kktix"]["auto_press_next_step_button"] = True config_dict["date_auto_select"]["enable"] = True
config_dict["kktix"]["auto_fill_ticket_number"] = True config_dict["date_auto_select"]["date_keyword"] = ""
config_dict["date_auto_select"]["mode"] = CONST_SELECT_ORDER_DEFAULT
config_dict['tixcraft']={}
config_dict["tixcraft"]["date_auto_select"] = {}
config_dict["tixcraft"]["date_auto_select"]["enable"] = True
config_dict["tixcraft"]["date_auto_select"]["date_keyword"] = ""
config_dict["tixcraft"]["date_auto_select"]["mode"] = CONST_SELECT_ORDER_DEFAULT
config_dict["area_auto_select"] = {} config_dict["area_auto_select"] = {}
config_dict["area_auto_select"]["enable"] = True config_dict["area_auto_select"]["enable"] = True
@ -652,6 +647,11 @@ def get_default_config():
config_dict["area_auto_select"]["area_keyword"] = "" config_dict["area_auto_select"]["area_keyword"] = ""
config_dict["keyword_exclude"] = CONST_EXCLUDE_DEFAULT config_dict["keyword_exclude"] = CONST_EXCLUDE_DEFAULT
config_dict['kktix']={}
config_dict["kktix"]["auto_press_next_step_button"] = True
config_dict["kktix"]["auto_fill_ticket_number"] = True
config_dict['tixcraft']={}
config_dict["tixcraft"]["pass_date_is_sold_out"] = True config_dict["tixcraft"]["pass_date_is_sold_out"] = True
config_dict["tixcraft"]["auto_reload_coming_soon_page"] = True config_dict["tixcraft"]["auto_reload_coming_soon_page"] = True
@ -869,12 +869,12 @@ def btn_save_act(language_code, slience_mode=False):
config_dict["kktix"]["auto_press_next_step_button"] = bool(chk_state_auto_press_next_step_button.get()) config_dict["kktix"]["auto_press_next_step_button"] = bool(chk_state_auto_press_next_step_button.get())
config_dict["kktix"]["auto_fill_ticket_number"] = bool(chk_state_auto_fill_ticket_number.get()) config_dict["kktix"]["auto_fill_ticket_number"] = bool(chk_state_auto_fill_ticket_number.get())
config_dict["tixcraft"]["date_auto_select"]["enable"] = bool(chk_state_date_auto_select.get()) config_dict["date_auto_select"]["enable"] = bool(chk_state_date_auto_select.get())
config_dict["tixcraft"]["date_auto_select"]["mode"] = combo_date_auto_select_mode.get().strip() config_dict["date_auto_select"]["mode"] = combo_date_auto_select_mode.get().strip()
date_keyword = txt_date_keyword.get("1.0",END).strip() date_keyword = txt_date_keyword.get("1.0",END).strip()
date_keyword = format_config_keyword_for_json(date_keyword) date_keyword = format_config_keyword_for_json(date_keyword)
config_dict["tixcraft"]["date_auto_select"]["date_keyword"] = date_keyword config_dict["date_auto_select"]["date_keyword"] = date_keyword
config_dict["tixcraft"]["pass_date_is_sold_out"] = bool(chk_state_pass_date_is_sold_out.get()) config_dict["tixcraft"]["pass_date_is_sold_out"] = bool(chk_state_pass_date_is_sold_out.get())
config_dict["tixcraft"]["auto_reload_coming_soon_page"] = bool(chk_state_auto_reload_coming_soon_page.get()) config_dict["tixcraft"]["auto_reload_coming_soon_page"] = bool(chk_state_auto_reload_coming_soon_page.get())
@ -1731,7 +1731,7 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
global chk_state_date_auto_select global chk_state_date_auto_select
chk_state_date_auto_select = BooleanVar() chk_state_date_auto_select = BooleanVar()
chk_state_date_auto_select.set(config_dict["tixcraft"]["date_auto_select"]["enable"]) chk_state_date_auto_select.set(config_dict["date_auto_select"]["enable"])
global chk_date_auto_select global chk_date_auto_select
chk_date_auto_select = Checkbutton(frame_group_tixcraft, text=translate[language_code]['enable'], variable=chk_state_date_auto_select, command=callbackDateAutoOnChange) chk_date_auto_select = Checkbutton(frame_group_tixcraft, text=translate[language_code]['enable'], variable=chk_state_date_auto_select, command=callbackDateAutoOnChange)
@ -1749,7 +1749,7 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
global combo_date_auto_select_mode global combo_date_auto_select_mode
combo_date_auto_select_mode = ttk.Combobox(frame_group_tixcraft, state="readonly", width=30) combo_date_auto_select_mode = ttk.Combobox(frame_group_tixcraft, state="readonly", width=30)
combo_date_auto_select_mode['values']= CONST_SELECT_OPTIONS_DEFAULT combo_date_auto_select_mode['values']= CONST_SELECT_OPTIONS_DEFAULT
combo_date_auto_select_mode.set(config_dict["tixcraft"]["date_auto_select"]["mode"]) combo_date_auto_select_mode.set(config_dict["date_auto_select"]["mode"])
combo_date_auto_select_mode.grid(column=1, row=date_auto_select_mode_index, sticky = W) combo_date_auto_select_mode.grid(column=1, row=date_auto_select_mode_index, sticky = W)
group_row_count+=1 group_row_count+=1
@ -1764,7 +1764,7 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
global txt_date_keyword global txt_date_keyword
txt_date_keyword = Text(frame_group_tixcraft, width=30, height=4) txt_date_keyword = Text(frame_group_tixcraft, width=30, height=4)
txt_date_keyword.grid(column=1, row=group_row_count, sticky = W) txt_date_keyword.grid(column=1, row=group_row_count, sticky = W)
txt_date_keyword.insert("1.0", config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip()) txt_date_keyword.insert("1.0", config_dict["date_auto_select"]["date_keyword"].strip())
group_row_count+=1 group_row_count+=1

View File

@ -27,7 +27,7 @@ import pyperclip
import tornado import tornado
from tornado.web import Application from tornado.web import Application
CONST_APP_VERSION = "MaxBot (2023.12.27)" CONST_APP_VERSION = "MaxBot (2023.12.28)"
CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt" CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt"

View File

@ -1 +1 @@
{"homepage": "https://tixcraft.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true}, "tixcraft": {"date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "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\"", "advanced": {"play_captcha_sound": {"enable": 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": "", "adblock_plus_enable": false, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "online_dictionary_url": "", "auto_reload_page_interval": 1.0, "auto_reload_random_delay": false, "proxy_server_port": ""}} {"homepage": "https://kktix.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "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}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_captcha_sound": {"enable": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "weng.32002@gmail.com", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "eXlme2omX3Nq", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "adblock_plus_enable": false, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "online_dictionary_url": "", "auto_reload_page_interval": 1.0, "auto_reload_random_delay": false, "proxy_server_port": ""}}

View File

@ -19,13 +19,13 @@ function get_target_date_with_order(settings, matched_block)
//console.log(settings); //console.log(settings);
let target_area = []; let target_area = [];
if(settings.tixcraft.date_auto_select.mode=="from top to bottom") if(settings.date_auto_select.mode=="from top to bottom")
target_date = matched_block.first(); target_date = matched_block.first();
if(settings.tixcraft.date_auto_select.mode=="from bottom to top") if(settings.date_auto_select.mode=="from bottom to top")
target_date = matched_block.last(); target_date = matched_block.last();
if(settings.tixcraft.date_auto_select.mode=="center") if(settings.date_auto_select.mode=="center")
target_date = matched_block.first(); target_date = matched_block.first();
if(settings.tixcraft.date_auto_select.mode=="random") if(settings.date_auto_select.mode=="random")
target_date = matched_block.first(); target_date = matched_block.first();
return target_area; return target_area;

View File

@ -32,7 +32,6 @@
<div class="col-12"> <div class="col-12">
<label for="date_select_mode" class="form-label">Date Select Order</label> <label for="date_select_mode" class="form-label">Date Select Order</label>
<select id="date_select_mode" class="form-select" aria-label="Default select"> <select id="date_select_mode" class="form-select" aria-label="Default select">
<option selected>Select Mode</option>
<option value="from top to bottom">from top to bottom</option> <option value="from top to bottom">from top to bottom</option>
<option value="from bottom to top">from bottom to top</option> <option value="from bottom to top">from bottom to top</option>
<option value="center">center</option> <option value="center">center</option>
@ -47,7 +46,6 @@
<div class="col-12"> <div class="col-12">
<label for="area_select_mode" class="form-label">Area Select Order</label> <label for="area_select_mode" class="form-label">Area Select Order</label>
<select id="area_select_mode" class="form-select" aria-label="Default select"> <select id="area_select_mode" class="form-select" aria-label="Default select">
<option selected>Select Mode</option>
<option value="from top to bottom">from top to bottom</option> <option value="from top to bottom">from top to bottom</option>
<option value="from bottom to top">from bottom to top</option> <option value="from bottom to top">from bottom to top</option>
<option value="center">center</option> <option value="center">center</option>