2022-11-22, KKTix add keyword #2

master
CHUN YU YAO 2022-11-23 12:39:46 +08:00
parent 42437ff966
commit d9f04e0a84
2 changed files with 248 additions and 259 deletions

View File

@ -39,7 +39,7 @@ warnings.simplefilter('ignore',InsecureRequestWarning)
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 (2022.11.21)" CONST_APP_VERSION = u"MaxBot (2022.11.22)"
CONST_HOMEPAGE_DEFAULT = "https://tixcraft.com" CONST_HOMEPAGE_DEFAULT = "https://tixcraft.com"
CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom"
@ -282,197 +282,144 @@ def get_driver_by_config(config_dict, driver_type):
debugMode = False debugMode = False
if not config_dict is None: # read config.
# read config. homepage = config_dict["homepage"]
if 'homepage' in config_dict: browser = config_dict["browser"]
homepage = config_dict["homepage"]
if 'browser' in config_dict:
browser = config_dict["browser"]
# output debug message in client side. # output debug message in client side.
if 'debug' in config_dict: debugMode = config_dict["debug"]
debugMode = config_dict["debug"] ticket_number = str(config_dict["ticket_number"])
# default ticket number # for ["kktix"]
# 說明:自動選擇的票數 auto_press_next_step_button = config_dict["kktix"]["auto_press_next_step_button"]
#ticket_number = "2" auto_fill_ticket_number = config_dict["kktix"]["auto_fill_ticket_number"]
ticket_number = "" kktix_area_auto_select_mode = config_dict["kktix"]["area_mode"].strip()
if 'ticket_number' in config_dict: if not kktix_area_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY:
ticket_number = str(config_dict["ticket_number"]) kktix_area_auto_select_mode = CONST_SELECT_ORDER_DEFAULT
# for ["kktix"] kktix_area_keyword_1 = config_dict["kktix"]["area_keyword_1"].strip()
if 'kktix' in config_dict: kktix_area_keyword_1_and = config_dict["kktix"]["area_keyword_1_and"].strip()
auto_press_next_step_button = config_dict["kktix"]["auto_press_next_step_button"] kktix_area_keyword_2 = config_dict["kktix"]["area_keyword_2"].strip()
auto_fill_ticket_number = config_dict["kktix"]["auto_fill_ticket_number"] kktix_area_keyword_2_and = config_dict["kktix"]["area_keyword_2_and"].strip()
if 'area_mode' in config_dict["kktix"]: # disable password brute force attack
kktix_area_auto_select_mode = config_dict["kktix"]["area_mode"].strip() # PS: because of the question is always variable.
if not kktix_area_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY:
kktix_area_auto_select_mode = CONST_SELECT_ORDER_DEFAULT
if 'area_keyword' in config_dict["kktix"]: auto_guess_options = config_dict["kktix"]["auto_guess_options"]
kktix_area_keyword = config_dict["kktix"]["area_keyword"]
if kktix_area_keyword is None:
kktix_area_keyword = ""
kktix_area_keyword = kktix_area_keyword.strip()
if 'date_keyword' in config_dict["kktix"]: # for ["tixcraft"]
kktix_date_keyword = config_dict["kktix"]["date_keyword"] date_auto_select_enable = config_dict["tixcraft"]["date_auto_select"]["enable"]
if kktix_date_keyword is None: date_auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"]
kktix_date_keyword = "" if not date_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY:
kktix_date_keyword = kktix_date_keyword.strip() date_auto_select_mode = CONST_SELECT_ORDER_DEFAULT
# disable password brute force attack date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip()
# PS: because of the question is always variable.
if 'auto_guess_options' in config_dict["kktix"]: area_auto_select_enable = config_dict["tixcraft"]["area_auto_select"]["enable"]
auto_guess_options = config_dict["kktix"]["auto_guess_options"] area_auto_select_mode = config_dict["tixcraft"]["area_auto_select"]["mode"]
if not area_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY:
area_auto_select_mode = CONST_SELECT_ORDER_DEFAULT
# for ["tixcraft"] area_keyword_1 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_1"].strip()
if 'tixcraft' in config_dict: area_keyword_2 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_2"].strip()
date_auto_select_enable = False area_keyword_3 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_3"].strip()
date_auto_select_mode = None area_keyword_4 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_4"].strip()
if 'date_auto_select' in config_dict["tixcraft"]: pass_1_seat_remaining_enable = config_dict["tixcraft"]["pass_1_seat_remaining"]
date_auto_select_enable = config_dict["tixcraft"]["date_auto_select"]["enable"] pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"]
date_auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
if not date_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY: # output config:
date_auto_select_mode = CONST_SELECT_ORDER_DEFAULT print("maxbot app version", CONST_APP_VERSION)
print("python version", platform.python_version())
print("homepage", homepage)
print("browser", browser)
print("ticket_number", ticket_number)
if 'date_keyword' in config_dict["tixcraft"]["date_auto_select"]: # for kktix
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"] print("==[kktix]==")
date_keyword = date_keyword.strip() print("auto_press_next_step_button", auto_press_next_step_button)
print("auto_fill_ticket_number", auto_fill_ticket_number)
print("kktix_area_keyword_1", kktix_area_keyword_1)
print("kktix_area_keyword_1_and", kktix_area_keyword_1_and)
print("kktix_area_keyword_2", kktix_area_keyword_2)
print("kktix_area_keyword_2_and", kktix_area_keyword_2_and)
print("auto_guess_options", auto_guess_options)
area_auto_select_enable = False # for tixcraft
area_auto_select_mode = None print("==[tixcraft]==")
print("date_auto_select_enable", date_auto_select_enable)
print("date_auto_select_mode", date_auto_select_mode)
print("date_keyword", date_keyword)
if 'area_auto_select' in config_dict["tixcraft"]: print("area_auto_select_enable", area_auto_select_enable)
area_auto_select_enable = config_dict["tixcraft"]["area_auto_select"]["enable"] print("area_auto_select_mode", area_auto_select_mode)
area_auto_select_mode = config_dict["tixcraft"]["area_auto_select"]["mode"] print("area_keyword_1", area_keyword_1)
print("area_keyword_2", area_keyword_2)
print("area_keyword_3", area_keyword_3)
print("area_keyword_4", area_keyword_4)
if not area_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY: print("pass_1_seat_remaining", pass_1_seat_remaining_enable)
area_auto_select_mode = CONST_SELECT_ORDER_DEFAULT print("pass_date_is_sold_out", pass_date_is_sold_out_enable)
print("auto_reload_coming_soon_page", auto_reload_coming_soon_page_enable)
print("debug Mode", debugMode)
if 'area_keyword_1' in config_dict["tixcraft"]["area_auto_select"]: # entry point
area_keyword_1 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_1"] if homepage is None:
area_keyword_1 = area_keyword_1.strip() homepage = ""
if len(homepage) == 0:
homepage = CONST_HOMEPAGE_DEFAULT
if 'area_keyword_2' in config_dict["tixcraft"]["area_auto_select"]: Root_Dir = get_app_root()
area_keyword_2 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_2"] webdriver_path = os.path.join(Root_Dir, "webdriver")
area_keyword_2 = area_keyword_2.strip() print("platform.system().lower():", platform.system().lower())
if 'area_keyword_3' in config_dict["tixcraft"]["area_auto_select"]: adblock_plus_enable = config_dict["advanced"]["adblock_plus_enable"]
area_keyword_3 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_3"] print("adblock_plus_enable:", adblock_plus_enable)
area_keyword_3 = area_keyword_3.strip()
if 'area_keyword_4' in config_dict["tixcraft"]["area_auto_select"]: if browser == "chrome":
area_keyword_4 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_4"] # method 6: Selenium Stealth
area_keyword_4 = area_keyword_4.strip() if driver_type != "undetected_chromedriver":
driver = load_chromdriver_normal(webdriver_path, driver_type, adblock_plus_enable)
pass_1_seat_remaining_enable = False
if 'pass_1_seat_remaining' in config_dict["tixcraft"]:
pass_1_seat_remaining_enable = config_dict["tixcraft"]["pass_1_seat_remaining"]
pass_date_is_sold_out_enable = False
if 'pass_date_is_sold_out' in config_dict["tixcraft"]:
pass_date_is_sold_out_enable = config_dict["tixcraft"]["pass_date_is_sold_out"]
auto_reload_coming_soon_page_enable = True
if 'auto_reload_coming_soon_page' in config_dict["tixcraft"]:
auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
# output config:
print("maxbot app version", CONST_APP_VERSION)
print("python version", platform.python_version())
print("homepage", homepage)
print("browser", browser)
print("ticket_number", ticket_number)
# for kktix
print("==[kktix]==")
print("auto_press_next_step_button", auto_press_next_step_button)
print("auto_fill_ticket_number", auto_fill_ticket_number)
print("kktix_area_keyword", kktix_area_keyword)
print("kktix_date_keyword", kktix_date_keyword)
print("auto_guess_options", auto_guess_options)
# for tixcraft
print("==[tixcraft]==")
print("date_auto_select_enable", date_auto_select_enable)
print("date_auto_select_mode", date_auto_select_mode)
print("date_keyword", date_keyword)
print("area_auto_select_enable", area_auto_select_enable)
print("area_auto_select_mode", area_auto_select_mode)
print("area_keyword_1", area_keyword_1)
print("area_keyword_2", area_keyword_2)
print("area_keyword_3", area_keyword_3)
print("area_keyword_4", area_keyword_4)
print("pass_1_seat_remaining", pass_1_seat_remaining_enable)
print("pass_date_is_sold_out", pass_date_is_sold_out_enable)
print("auto_reload_coming_soon_page", auto_reload_coming_soon_page_enable)
print("debug Mode", debugMode)
# entry point
if homepage is None:
homepage = ""
if len(homepage) == 0:
homepage = CONST_HOMEPAGE_DEFAULT
Root_Dir = get_app_root()
webdriver_path = os.path.join(Root_Dir, "webdriver")
print("platform.system().lower():", platform.system().lower())
adblock_plus_enable = config_dict["advanced"]["adblock_plus_enable"]
print("adblock_plus_enable:", adblock_plus_enable)
if browser == "chrome":
# method 6: Selenium Stealth
if driver_type != "undetected_chromedriver":
driver = load_chromdriver_normal(webdriver_path, driver_type, adblock_plus_enable)
else:
# method 5: uc
# multiprocessing not work bug.
if platform.system().lower()=="windows":
if hasattr(sys, 'frozen'):
from multiprocessing import freeze_support
freeze_support()
driver = load_chromdriver_uc(webdriver_path, adblock_plus_enable)
if browser == "firefox":
# default os is linux/mac
chromedriver_path = os.path.join(webdriver_path,"geckodriver")
if platform.system().lower()=="windows":
chromedriver_path = os.path.join(webdriver_path,"geckodriver.exe")
firefox_service = Service(chromedriver_path)
driver = webdriver.Firefox(service=firefox_service)
#print("try to close opened tabs.")
'''
time.sleep(1.0)
for i in range(1):
close_browser_tabs(driver)
'''
if driver is None:
print("create web driver object fail @_@;")
else: else:
try: # method 5: uc
print("goto url:", homepage) # multiprocessing not work bug.
if homepage=="https://tixcraft.com": if platform.system().lower()=="windows":
homepage="https://tixcraft.com/user/changeLanguage/lang/zh_tw" if hasattr(sys, 'frozen'):
driver.get(homepage) from multiprocessing import freeze_support
except WebDriverException as exce2: freeze_support()
print('oh no not again, WebDriverException') driver = load_chromdriver_uc(webdriver_path, adblock_plus_enable)
print('WebDriverException:', exce2)
except Exception as exce1: if browser == "firefox":
print('get URL Exception:', exec1) # default os is linux/mac
pass chromedriver_path = os.path.join(webdriver_path,"geckodriver")
if platform.system().lower()=="windows":
chromedriver_path = os.path.join(webdriver_path,"geckodriver.exe")
firefox_service = Service(chromedriver_path)
driver = webdriver.Firefox(service=firefox_service)
#print("try to close opened tabs.")
'''
time.sleep(1.0)
for i in range(1):
close_browser_tabs(driver)
'''
if driver is None:
print("create web driver object fail @_@;")
else: else:
print("Config error!") try:
print("goto url:", homepage)
if homepage=="https://tixcraft.com":
homepage="https://tixcraft.com/user/changeLanguage/lang/zh_tw"
driver.get(homepage)
except WebDriverException as exce2:
print('oh no not again, WebDriverException')
print('WebDriverException:', exce2)
except Exception as exce1:
print('get URL Exception:', exec1)
pass
return driver return driver
@ -1750,7 +1697,7 @@ def kktix_input_captcha_text(captcha_password_input_tag, captcha_password_string
return is_cpatcha_sent return is_cpatcha_sent
def kktix_travel_price_list(driver, kktix_area_keyword, kktix_date_keyword): def kktix_travel_price_list(driver, kktix_area_keyword_1, kktix_area_keyword_1_and):
show_debug_message = True # debug. show_debug_message = True # debug.
show_debug_message = False # online show_debug_message = False # online
@ -1781,12 +1728,12 @@ def kktix_travel_price_list(driver, kktix_area_keyword, kktix_date_keyword):
areas = [] areas = []
# clean stop word. # clean stop word.
kktix_area_keyword = format_keyword_string(kktix_area_keyword) kktix_area_keyword_1 = format_keyword_string(kktix_area_keyword_1)
kktix_date_keyword = format_keyword_string(kktix_date_keyword) kktix_area_keyword_1_and = format_keyword_string(kktix_area_keyword_1_and)
if show_debug_message: if show_debug_message:
print('kktix_area_keyword:', kktix_area_keyword) print('kktix_area_keyword_1:', kktix_area_keyword_1)
print('kktix_date_keyword:', kktix_date_keyword) print('kktix_area_keyword_1_and:', kktix_area_keyword_1_and)
row_index = 0 row_index = 0
for row in ticket_price_list: for row in ticket_price_list:
@ -1838,23 +1785,23 @@ def kktix_travel_price_list(driver, kktix_area_keyword, kktix_date_keyword):
is_match_area = False is_match_area = False
match_area_code = 0 match_area_code = 0
if len(kktix_area_keyword) == 0: if len(kktix_area_keyword_1) == 0:
# keyword #1, empty, direct add to list. # keyword #1, empty, direct add to list.
is_match_area = True is_match_area = True
match_area_code = 1 match_area_code = 1
else: else:
# MUST match keyword #1. # MUST match keyword #1.
if kktix_area_keyword in row_text: if kktix_area_keyword_1 in row_text:
#print('match keyword#1') #print('match keyword#1')
# because of logic between keywords is AND! # because of logic between keywords is AND!
if len(kktix_date_keyword) == 0: if len(kktix_area_keyword_1_and) == 0:
#print('keyword#2 is empty, directly match.') #print('keyword#2 is empty, directly match.')
# keyword #2 is empty, direct append. # keyword #2 is empty, direct append.
is_match_area = True is_match_area = True
match_area_code = 2 match_area_code = 2
else: else:
if kktix_date_keyword in row_text: if kktix_area_keyword_1_and in row_text:
#print('match keyword#2') #print('match keyword#2')
is_match_area = True is_match_area = True
match_area_code = 3 match_area_code = 3
@ -1886,11 +1833,11 @@ def kktix_travel_price_list(driver, kktix_area_keyword, kktix_date_keyword):
return is_ticket_number_assigened, areas return is_ticket_number_assigened, areas
def kktix_assign_ticket_number(driver, ticket_number, kktix_area_auto_select_mode, kktix_area_keyword, kktix_date_keyword): def kktix_assign_ticket_number(driver, ticket_number, kktix_area_auto_select_mode, kktix_area_keyword_1, kktix_area_keyword_1_and):
show_debug_message = True # debug. show_debug_message = True # debug.
show_debug_message = False # online show_debug_message = False # online
is_ticket_number_assigened, areas = kktix_travel_price_list(driver, kktix_area_keyword, kktix_date_keyword) is_ticket_number_assigened, areas = kktix_travel_price_list(driver, kktix_area_keyword_1, kktix_area_keyword_1_and)
target_area = None target_area = None
if not is_ticket_number_assigened: if not is_ticket_number_assigened:
@ -2530,11 +2477,17 @@ def kktix_reg_new_main(driver, answer_index, is_finish_checkbox_click, config_di
is_assign_ticket_number = False is_assign_ticket_number = False
if not registrationsNewApp_div is None: if not registrationsNewApp_div is None:
kktix_area_auto_select_mode = config_dict["kktix"]["area_mode"] kktix_area_auto_select_mode = config_dict["kktix"]["area_mode"]
kktix_area_keyword = config_dict["kktix"]["area_keyword"].strip() kktix_area_keyword_1 = config_dict["kktix"]["area_keyword_1"].strip()
kktix_date_keyword = config_dict["kktix"]["date_keyword"].strip() kktix_area_keyword_1_and = config_dict["kktix"]["area_keyword_1_and"].strip()
kktix_area_keyword_2 = config_dict["kktix"]["area_keyword_2"].strip()
kktix_area_keyword_2_and = config_dict["kktix"]["area_keyword_2_and"].strip()
for retry_index in range(3): for retry_index in range(2):
is_assign_ticket_number = kktix_assign_ticket_number(driver, ticket_number, kktix_area_auto_select_mode, kktix_area_keyword, kktix_date_keyword) is_assign_ticket_number = kktix_assign_ticket_number(driver, ticket_number, kktix_area_auto_select_mode, kktix_area_keyword_1, kktix_area_keyword_1_and)
if not is_assign_ticket_number:
is_assign_ticket_number = kktix_assign_ticket_number(driver, ticket_number, kktix_area_auto_select_mode, kktix_area_keyword_1, kktix_area_keyword_1_and)
if not is_assign_ticket_number:
is_assign_ticket_number = kktix_assign_ticket_number(driver, ticket_number, kktix_area_auto_select_mode, kktix_area_keyword_2, kktix_area_keyword_2_and)
if is_assign_ticket_number: if is_assign_ticket_number:
break break
#print('is_assign_ticket_number:', is_assign_ticket_number) #print('is_assign_ticket_number:', is_assign_ticket_number)
@ -3663,7 +3616,11 @@ def main():
#driver_type = 'stealth' #driver_type = 'stealth'
driver_type = 'undetected_chromedriver' driver_type = 'undetected_chromedriver'
driver = get_driver_by_config(config_dict, driver_type) driver = None
if not config_dict is None:
driver = get_driver_by_config(config_dict, driver_type)
else:
print("Config error!")
# internal variable. 說明:這是一個內部變數,請略過。 # internal variable. 說明:這是一個內部變數,請略過。
url = "" url = ""

View File

@ -19,7 +19,7 @@ import json
import webbrowser import webbrowser
import pyperclip import pyperclip
CONST_APP_VERSION = u"MaxBot (2022.11.21)" CONST_APP_VERSION = u"MaxBot (2022.11.22)"
CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom" CONST_FROM_TOP_TO_BOTTOM = u"from top to bottom"
CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top"
@ -262,8 +262,10 @@ def get_default_config():
config_dict["kktix"]["auto_press_next_step_button"] = True config_dict["kktix"]["auto_press_next_step_button"] = True
config_dict["kktix"]["auto_fill_ticket_number"] = True config_dict["kktix"]["auto_fill_ticket_number"] = True
config_dict["kktix"]["area_mode"] = CONST_SELECT_ORDER_DEFAULT config_dict["kktix"]["area_mode"] = CONST_SELECT_ORDER_DEFAULT
config_dict["kktix"]["area_keyword"] = "" config_dict["kktix"]["area_keyword_1"] = ""
config_dict["kktix"]["date_keyword"] = "" config_dict["kktix"]["area_keyword_1_and"] = ""
config_dict["kktix"]["area_keyword_2"] = ""
config_dict["kktix"]["area_keyword_2_and"] = ""
config_dict["kktix"]["auto_guess_options"] = True config_dict["kktix"]["auto_guess_options"] = True
config_dict['tixcraft']={} config_dict['tixcraft']={}
@ -328,8 +330,10 @@ def btn_save_act(slience_mode=False):
global chk_state_auto_press_next_step_button global chk_state_auto_press_next_step_button
global chk_state_auto_fill_ticket_number global chk_state_auto_fill_ticket_number
global txt_kktix_area_keyword global txt_kktix_area_keyword_1
global txt_kktix_date_keyword global txt_kktix_area_keyword_1_and
global txt_kktix_area_keyword_2
global txt_kktix_area_keyword_2_and
# disable password brute force attack # disable password brute force attack
global txt_kktix_answer_dictionary global txt_kktix_answer_dictionary
@ -386,21 +390,17 @@ def btn_save_act(slience_mode=False):
config_dict["ticket_number"] = int(combo_ticket_number.get().strip()) config_dict["ticket_number"] = int(combo_ticket_number.get().strip())
if is_all_data_correct: if is_all_data_correct:
if not 'kktix' in config_dict:
config_dict['kktix']={}
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["kktix"]["area_mode"] = combo_kktix_area_mode.get().strip() config_dict["kktix"]["area_mode"] = combo_kktix_area_mode.get().strip()
config_dict["kktix"]["area_keyword"] = txt_kktix_area_keyword.get().strip() config_dict["kktix"]["area_keyword_1"] = txt_kktix_area_keyword_1.get().strip()
config_dict["kktix"]["date_keyword"] = txt_kktix_date_keyword.get().strip() config_dict["kktix"]["area_keyword_1_and"] = txt_kktix_area_keyword_1_and.get().strip()
config_dict["kktix"]["area_keyword_2"] = txt_kktix_area_keyword_2.get().strip()
config_dict["kktix"]["area_keyword_2_and"] = txt_kktix_area_keyword_2_and.get().strip()
# disable password brute force attack # disable password brute force attack
#config_dict["kktix"]["answer_dictionary"] = txt_kktix_answer_dictionary.get().strip() #config_dict["kktix"]["answer_dictionary"] = txt_kktix_answer_dictionary.get().strip()
config_dict["kktix"]["auto_guess_options"] = bool(chk_state_auto_guess_options.get()) config_dict["kktix"]["auto_guess_options"] = bool(chk_state_auto_guess_options.get())
if not 'tixcraft' in config_dict:
config_dict['tixcraft']={}
config_dict["tixcraft"]["date_auto_select"]["enable"] = bool(chk_state_date_auto_select.get()) config_dict["tixcraft"]["date_auto_select"]["enable"] = bool(chk_state_date_auto_select.get())
config_dict["tixcraft"]["date_auto_select"]["date_keyword"] = txt_date_keyword.get().strip() config_dict["tixcraft"]["date_auto_select"]["date_keyword"] = txt_date_keyword.get().strip()
@ -417,12 +417,6 @@ def btn_save_act(slience_mode=False):
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())
if not 'advanced' in config_dict:
config_dict['advanced']={}
if not 'play_captcha_sound' in config_dict['advanced']:
config_dict['advanced']['play_captcha_sound']={}
config_dict["advanced"]["play_captcha_sound"]["enable"] = bool(chk_state_play_captcha_sound.get()) config_dict["advanced"]["play_captcha_sound"]["enable"] = bool(chk_state_play_captcha_sound.get())
config_dict["advanced"]["play_captcha_sound"]["filename"] = txt_captcha_sound_filename.get().strip() config_dict["advanced"]["play_captcha_sound"]["filename"] = txt_captcha_sound_filename.get().strip()
@ -563,8 +557,10 @@ def applyNewLanguage():
global lbl_auto_press_next_step_button global lbl_auto_press_next_step_button
global lbl_auto_fill_ticket_number global lbl_auto_fill_ticket_number
global lbl_kktix_area_mode global lbl_kktix_area_mode
global lbl_kktix_area_keyword global lbl_kktix_area_keyword_1
global lbl_kktix_area_keyword_and_text global lbl_kktix_area_keyword_1_and_text
global lbl_kktix_area_keyword_2
global lbl_kktix_area_keyword_2_and_text
global lbl_auto_guess_options global lbl_auto_guess_options
# for tixcraft # for tixcraft
@ -612,8 +608,10 @@ def applyNewLanguage():
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"])
lbl_kktix_area_mode.config(text=translate[language_code]["area_select_order"]) lbl_kktix_area_mode.config(text=translate[language_code]["area_select_order"])
lbl_kktix_area_keyword.config(text=translate[language_code]["area_keyword"]) lbl_kktix_area_keyword_1.config(text=translate[language_code]["area_keyword_1"])
lbl_kktix_area_keyword_and_text.config(text=translate[language_code]["and"]) lbl_kktix_area_keyword_1_and_text.config(text=translate[language_code]["and"])
lbl_kktix_area_keyword_2.config(text=translate[language_code]["area_keyword_2"])
lbl_kktix_area_keyword_2_and_text.config(text=translate[language_code]["and"])
lbl_auto_guess_options.config(text=translate[language_code]["auto_guess_options"]) lbl_auto_guess_options.config(text=translate[language_code]["auto_guess_options"])
lbl_date_auto_select.config(text=translate[language_code]["date_auto_select"]) lbl_date_auto_select.config(text=translate[language_code]["date_auto_select"])
lbl_date_auto_select_mode.config(text=translate[language_code]["date_select_order"]) lbl_date_auto_select_mode.config(text=translate[language_code]["date_select_order"])
@ -839,8 +837,10 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
auto_fill_ticket_number = False auto_fill_ticket_number = False
kktix_area_mode = "" kktix_area_mode = ""
kktix_area_keyword = "" kktix_area_keyword_1 = ""
kktix_date_keyword = "" kktix_area_keyword_1_and = ""
kktix_area_keyword_2 = ""
kktix_area_keyword_2_and = ""
# disable password brute force attack # disable password brute force attack
# PS: because of the question is always variable. # PS: because of the question is always variable.
#kktix_answer_dictionary = "" #kktix_answer_dictionary = ""
@ -879,8 +879,10 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
kktix_area_mode = config_dict["kktix"]["area_mode"].strip() kktix_area_mode = config_dict["kktix"]["area_mode"].strip()
if not kktix_area_mode in CONST_SELECT_OPTIONS_ARRAY: if not kktix_area_mode in CONST_SELECT_OPTIONS_ARRAY:
kktix_area_mode = CONST_SELECT_ORDER_DEFAULT kktix_area_mode = CONST_SELECT_ORDER_DEFAULT
kktix_area_keyword = config_dict["kktix"]["area_keyword"].strip() kktix_area_keyword_1 = config_dict["kktix"]["area_keyword_1"].strip()
kktix_date_keyword = config_dict["kktix"]["date_keyword"].strip() kktix_area_keyword_1_and = config_dict["kktix"]["area_keyword_1_and"].strip()
kktix_area_keyword_2 = config_dict["kktix"]["area_keyword_2"].strip()
kktix_area_keyword_2_and = config_dict["kktix"]["area_keyword_2_and"].strip()
auto_guess_options = config_dict["kktix"]["auto_guess_options"] auto_guess_options = config_dict["kktix"]["auto_guess_options"]
# disable password brute force attack # disable password brute force attack
@ -922,8 +924,8 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
print("auto_press_next_step_button", auto_press_next_step_button) print("auto_press_next_step_button", auto_press_next_step_button)
print("auto_fill_ticket_number", auto_fill_ticket_number) print("auto_fill_ticket_number", auto_fill_ticket_number)
print("kktix_area_mode", kktix_area_mode) print("kktix_area_mode", kktix_area_mode)
print("kktix_area_keyword", kktix_area_keyword) print("kktix_area_keyword_1", kktix_area_keyword_1)
print("kktix_date_keyword", kktix_date_keyword) print("kktix_area_keyword_1_and", kktix_area_keyword_1_and)
# disable password brute force attack # disable password brute force attack
#print("kktix_answer_dictionary", kktix_answer_dictionary) #print("kktix_answer_dictionary", kktix_answer_dictionary)
print("auto_guess_options", auto_guess_options) print("auto_guess_options", auto_guess_options)
@ -1079,33 +1081,63 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
group_row_count+=1 group_row_count+=1
global lbl_kktix_area_keyword global lbl_kktix_area_keyword_1
lbl_kktix_area_keyword = Label(frame_group_kktix, text=translate[language_code]['area_keyword']) lbl_kktix_area_keyword_1 = Label(frame_group_kktix, text=translate[language_code]['area_keyword_1'])
lbl_kktix_area_keyword.grid(column=0, row=group_row_count, sticky = E) lbl_kktix_area_keyword_1.grid(column=0, row=group_row_count, sticky = E)
global txt_kktix_area_keyword global txt_kktix_area_keyword_1
txt_kktix_area_keyword_value = StringVar(frame_group_kktix, value=kktix_area_keyword) txt_kktix_area_keyword_1_value = StringVar(frame_group_kktix, value=kktix_area_keyword_1)
txt_kktix_area_keyword = Entry(frame_group_kktix, width=20, textvariable = txt_kktix_area_keyword_value) txt_kktix_area_keyword_1 = Entry(frame_group_kktix, width=20, textvariable = txt_kktix_area_keyword_1_value)
txt_kktix_area_keyword.grid(column=1, row=group_row_count, sticky = W) txt_kktix_area_keyword_1.grid(column=1, row=group_row_count, sticky = W)
group_row_count+=1 group_row_count+=1
lbl_kktix_area_keyword_and_label = Label(frame_group_kktix, text="") lbl_kktix_area_keyword_1_and_label = Label(frame_group_kktix, text="")
lbl_kktix_area_keyword_and_label.grid(column=0, row=group_row_count, sticky = E) lbl_kktix_area_keyword_1_and_label.grid(column=0, row=group_row_count, sticky = E)
global lbl_kktix_area_keyword_and_text global lbl_kktix_area_keyword_1_and_text
lbl_kktix_area_keyword_and_text = Label(frame_group_kktix, text=translate[language_code]['and']) lbl_kktix_area_keyword_1_and_text = Label(frame_group_kktix, text=translate[language_code]['and'])
lbl_kktix_area_keyword_and_text.grid(column=1, row=group_row_count, sticky = W) lbl_kktix_area_keyword_1_and_text.grid(column=1, row=group_row_count, sticky = W)
group_row_count+=1 group_row_count+=1
lbl_kktix_date_keyword = Label(frame_group_kktix, text="") lbl_kktix_area_keyword_1_tmp = Label(frame_group_kktix, text="")
lbl_kktix_date_keyword.grid(column=0, row=group_row_count, sticky = E) lbl_kktix_area_keyword_1_tmp.grid(column=0, row=group_row_count, sticky = E)
global txt_kktix_date_keyword global txt_kktix_area_keyword_1_and
txt_kktix_date_keyword_value = StringVar(frame_group_kktix, value=kktix_date_keyword) txt_kktix_area_keyword_1_and_value = StringVar(frame_group_kktix, value=kktix_area_keyword_1_and)
txt_kktix_date_keyword = Entry(frame_group_kktix, width=20, textvariable = txt_kktix_date_keyword_value) txt_kktix_area_keyword_1_and = Entry(frame_group_kktix, width=20, textvariable = txt_kktix_area_keyword_1_and_value)
txt_kktix_date_keyword.grid(column=1, row=group_row_count, sticky = W) txt_kktix_area_keyword_1_and.grid(column=1, row=group_row_count, sticky = W)
group_row_count+=1
global lbl_kktix_area_keyword_2
lbl_kktix_area_keyword_2 = Label(frame_group_kktix, text=translate[language_code]['area_keyword_2'])
lbl_kktix_area_keyword_2.grid(column=0, row=group_row_count, sticky = E)
global txt_kktix_area_keyword_2
txt_kktix_area_keyword_2_value = StringVar(frame_group_kktix, value=kktix_area_keyword_2)
txt_kktix_area_keyword_2 = Entry(frame_group_kktix, width=20, textvariable = txt_kktix_area_keyword_2_value)
txt_kktix_area_keyword_2.grid(column=1, row=group_row_count, sticky = W)
group_row_count+=1
lbl_kktix_area_keyword_2_and_label = Label(frame_group_kktix, text="")
lbl_kktix_area_keyword_2_and_label.grid(column=0, row=group_row_count, sticky = E)
global lbl_kktix_area_keyword_2_and_text
lbl_kktix_area_keyword_2_and_text = Label(frame_group_kktix, text=translate[language_code]['and'])
lbl_kktix_area_keyword_2_and_text.grid(column=1, row=group_row_count, sticky = W)
group_row_count+=1
lbl_kktix_area_keyword_2_tmp = Label(frame_group_kktix, text="")
lbl_kktix_area_keyword_2_tmp.grid(column=0, row=group_row_count, sticky = E)
global txt_kktix_area_keyword_2_and
txt_kktix_area_keyword_2_and_value = StringVar(frame_group_kktix, value=kktix_area_keyword_2_and)
txt_kktix_area_keyword_2_and = Entry(frame_group_kktix, width=20, textvariable = txt_kktix_area_keyword_2_and_value)
txt_kktix_area_keyword_2_and.grid(column=1, row=group_row_count, sticky = W)
#group_row_count+=1 #group_row_count+=1