2022-11-21, remove some not used source code.

master
CHUN YU YAO 2022-11-22 03:01:04 +08:00
parent 5db841acfe
commit 6eb00cfcdc
2 changed files with 264 additions and 352 deletions

View File

@ -39,7 +39,8 @@ 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.20)" CONST_APP_VERSION = u"MaxBot (2022.11.21)"
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"
CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top" CONST_FROM_BOTTOM_TO_TOP = u"from bottom to top"
@ -50,34 +51,6 @@ CONST_SELECT_OPTIONS_ARRAY = [CONST_FROM_TOP_TO_BOTTOM, CONST_FROM_BOTTOM_TO_TOP
CONT_STRING_1_SEATS_REMAINING = [u'@1 seat(s) remaining',u'剩餘 1@',u'@1 席残り'] CONT_STRING_1_SEATS_REMAINING = [u'@1 seat(s) remaining',u'剩餘 1@',u'@1 席残り']
driver = None
ticket_number = None
auto_press_next_step_button = False
auto_fill_ticket_number = False
auto_fill_ticket_price = None
date_auto_select_enable = False
date_auto_select_mode = None
date_keyword = None
area_auto_select_enable = False
area_auto_select_mode = None
area_keyword = None
area_keyword_1 = None
area_keyword_2 = None
area_keyword_3 = None
area_keyword_4 = None
pass_1_seat_remaining_enable = False # default not checked.
pass_date_is_sold_out_enable = False # default not checked.
auto_reload_coming_soon_page_enable = True # default checked.
kktix_area_auto_select_mode = None
kktix_area_keyword = None
kktix_date_keyword = None
def get_app_root(): def get_app_root():
# 讀取檔案裡的參數值 # 讀取檔案裡的參數值
@ -439,17 +412,14 @@ def get_driver_by_config(config_dict, driver_type):
print("pass_1_seat_remaining", pass_1_seat_remaining_enable) print("pass_1_seat_remaining", pass_1_seat_remaining_enable)
print("pass_date_is_sold_out", pass_date_is_sold_out_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("auto_reload_coming_soon_page", auto_reload_coming_soon_page_enable)
print("debug Mode", debugMode) print("debug Mode", debugMode)
# entry point # entry point
# 說明:自動開啟第一個的網頁
if homepage is None: if homepage is None:
homepage = "" homepage = ""
if len(homepage) == 0: if len(homepage) == 0:
homepage = "https://tixcraft.com" homepage = CONST_HOMEPAGE_DEFAULT
Root_Dir = get_app_root() Root_Dir = get_app_root()
webdriver_path = os.path.join(Root_Dir, "webdriver") webdriver_path = os.path.join(Root_Dir, "webdriver")
@ -458,70 +428,16 @@ def get_driver_by_config(config_dict, driver_type):
adblock_plus_enable = config_dict["advanced"]["adblock_plus_enable"] adblock_plus_enable = config_dict["advanced"]["adblock_plus_enable"]
if browser == "chrome": if browser == "chrome":
DEFAULT_ARGS = [
'--disable-audio-output',
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-breakpad',
'--disable-browser-side-navigation',
'--disable-checker-imaging',
'--disable-client-side-phishing-detection',
'--disable-default-apps',
'--disable-demo-mode',
'--disable-dev-shm-usage',
#'--disable-extensions',
'--disable-features=site-per-process',
'--disable-hang-monitor',
'--disable-in-process-stack-traces',
'--disable-javascript-harmony-shipping',
'--disable-logging',
'--disable-notifications',
'--disable-popup-blocking',
'--disable-prompt-on-repost',
'--disable-perfetto',
'--disable-permissions-api',
'--disable-plugins',
'--disable-presentation-api',
'--disable-reading-from-canvas',
'--disable-renderer-accessibility',
'--disable-renderer-backgrounding',
'--disable-shader-name-hashing',
'--disable-smooth-scrolling',
'--disable-speech-api',
'--disable-speech-synthesis-api',
'--disable-sync',
'--disable-translate',
'--ignore-certificate-errors',
'--metrics-recording-only',
'--no-first-run',
'--no-experiments',
'--safebrowsing-disable-auto-update',
#'--enable-automation',
'--password-store=basic',
'--use-mock-keychain',
'--lang=zh-TW',
'--stable-release-mode',
'--use-mobile-user-agent',
'--webview-disable-safebrowsing-support',
#'--no-sandbox',
#'--incognito',
]
# method 6: Selenium Stealth # method 6: Selenium Stealth
if driver_type != "undetected_chromedriver": if driver_type != "undetected_chromedriver":
driver = load_chromdriver_normal(webdriver_path, driver_type, adblock_plus_enable) driver = load_chromdriver_normal(webdriver_path, driver_type, adblock_plus_enable)
else: else:
# method 5: uc # method 5: uc
#options = webdriver.ChromeOptions()
# multiprocessing not work bug. # multiprocessing not work bug.
if platform.system().lower()=="windows": if platform.system().lower()=="windows":
if hasattr(sys, 'frozen'): if hasattr(sys, 'frozen'):
from multiprocessing import freeze_support from multiprocessing import freeze_support
freeze_support() freeze_support()
driver = load_chromdriver_uc(webdriver_path, adblock_plus_enable) driver = load_chromdriver_uc(webdriver_path, adblock_plus_enable)
if browser == "firefox": if browser == "firefox":
@ -554,13 +470,6 @@ def get_driver_by_config(config_dict, driver_type):
except Exception as exce1: except Exception as exce1:
print('get URL Exception:', exec1) print('get URL Exception:', exec1)
pass pass
'''
for i in range(1):
close_browser_tabs(driver)
'''
else: else:
print("Config error!") print("Config error!")
@ -3766,6 +3675,8 @@ def main():
answer_index = -1 answer_index = -1
kktix_register_status_last = None kktix_register_status_last = None
debugMode = False
if 'debug' in config_dict:
debugMode = config_dict["debug"] debugMode = config_dict["debug"]
if debugMode: if debugMode:
print("Start to looping, detect browser url...") print("Start to looping, detect browser url...")
@ -3821,6 +3732,8 @@ def main():
pass pass
except Exception as exc: except Exception as exc:
is_verifyCode_editing = False
logger.error('Maxbot URL Exception') logger.error('Maxbot URL Exception')
logger.error(exc, exc_info=True) logger.error(exc, exc_info=True)
@ -3841,7 +3754,9 @@ def main():
, u'Failed to establish a new connection' , u'Failed to establish a new connection'
, u'Connection refused' , u'Connection refused'
, u'disconnected' , u'disconnected'
, u'without establishing a connection'] , u'without establishing a connection'
, u'web view not found'
]
for each_error_string in exit_bot_error_strings: for each_error_string in exit_bot_error_strings:
# for python2 # for python2
# say goodbye to python2 # say goodbye to python2

View File

@ -19,7 +19,7 @@ import json
import webbrowser import webbrowser
import pyperclip import pyperclip
CONST_APP_VERSION = u"MaxBot (2022.11.20)" CONST_APP_VERSION = u"MaxBot (2022.11.21)"
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"
@ -34,13 +34,8 @@ tixcraft.com##.footer.clearfix
tixcraft.com##.row.process-wizard.process-wizard-info tixcraft.com##.row.process-wizard.process-wizard-info
tixcraft.com##.nav-line tixcraft.com##.nav-line
tixcraft.com##.page-info.row.line-btm.mg-0''' tixcraft.com##.page-info.row.line-btm.mg-0'''
config_filepath = None CONST_CAPTCHA_SOUND_FILENAME_DEFAULT = "ding-dong.wav"
config_dict = None CONST_HOMEPAGE_DEFAULT = "https://tixcraft.com"
window = None
btn_save = None
btn_exit = None
translate={} translate={}
@ -49,7 +44,6 @@ URL_HELP = 'https://max-everyday.com/2018/03/tixcraft-bot/'
URL_RELEASE = 'https://github.com/max32002/tixcraft_bot/releases' URL_RELEASE = 'https://github.com/max32002/tixcraft_bot/releases'
URL_FB = 'https://www.facebook.com/maxbot.ticket' URL_FB = 'https://www.facebook.com/maxbot.ticket'
def load_translate(): def load_translate():
translate = {} translate = {}
en_us={} en_us={}
@ -94,7 +88,7 @@ def load_translate():
en_us["adblock_plus_memo"] = 'Default adblock is disable' en_us["adblock_plus_memo"] = 'Default adblock is disable'
en_us["adblock_plus_settings"] = "Adblock Advanced Filter" en_us["adblock_plus_settings"] = "Adblock Advanced Filter"
en_us["maxbot_slogan"] = 'MaxBot is a FREE and open source bot program. Good luck getting your expected ticket.' en_us["maxbot_slogan"] = 'MaxBot is a FREE and open source bot program. Wish you good luck.'
en_us["donate"] = 'Donate' en_us["donate"] = 'Donate'
en_us["help"] = 'Help' en_us["help"] = 'Help'
en_us["release"] = 'Release' en_us["release"] = 'Release'
@ -141,7 +135,7 @@ def load_translate():
zh_tw["adblock_plus_memo"] = 'Adblock 功能預設關閉' zh_tw["adblock_plus_memo"] = 'Adblock 功能預設關閉'
zh_tw["adblock_plus_settings"] = "Adblock 進階過濾規則" zh_tw["adblock_plus_settings"] = "Adblock 進階過濾規則"
zh_tw["maxbot_slogan"] = 'MaxBot是一個免費、開放原始碼的搶票機器人。\n你好運,買得到預期中的票' zh_tw["maxbot_slogan"] = 'MaxBot是一個免費、開放原始碼的搶票機器人。\n您搶票成功'
zh_tw["donate"] = '打賞' zh_tw["donate"] = '打賞'
zh_tw["release"] = '所有可用版本' zh_tw["release"] = '所有可用版本'
zh_tw["help"] = '使用教學' zh_tw["help"] = '使用教學'
@ -188,7 +182,7 @@ def load_translate():
zh_cn["adblock_plus_memo"] = 'Adblock 功能预设关闭' zh_cn["adblock_plus_memo"] = 'Adblock 功能预设关闭'
zh_cn["adblock_plus_settings"] = "Adblock 进阶过滤规则" zh_cn["adblock_plus_settings"] = "Adblock 进阶过滤规则"
zh_cn["maxbot_slogan"] = 'MaxBot 是一个免费的开源机器人程序。\n你好运,买得到预期中的票' zh_cn["maxbot_slogan"] = 'MaxBot 是一个免费的开源机器人程序。\n您抢票成功'
zh_cn["donate"] = '打赏' zh_cn["donate"] = '打赏'
zh_cn["help"] = '使用教学' zh_cn["help"] = '使用教学'
zh_cn["release"] = '所有可用版本' zh_cn["release"] = '所有可用版本'
@ -235,8 +229,7 @@ def load_translate():
ja_jp["adblock_plus_enable"] = 'Adblock 拡張機能' ja_jp["adblock_plus_enable"] = 'Adblock 拡張機能'
ja_jp["adblock_plus_memo"] = 'Adblock デフォルトは無効です' ja_jp["adblock_plus_memo"] = 'Adblock デフォルトは無効です'
ja_jp["adblock_plus_settings"] = "Adblock 高度なフィルター" ja_jp["adblock_plus_settings"] = "Adblock 高度なフィルター"
ja_jp["maxbot_slogan"] = 'MaxBot は無料のオープン ソース ボット プログラムです。チケットの成功をお祈りします。'
ja_jp["maxbot_slogan"] = 'MaxBot は無料のオープン ソース ボット プログラムです。 頑張って予定のチケットを手に入れてください。'
ja_jp["donate"] = '寄付' ja_jp["donate"] = '寄付'
ja_jp["help"] = '利用方法' ja_jp["help"] = '利用方法'
ja_jp["release"] = 'リリース' ja_jp["release"] = 'リリース'
@ -257,6 +250,53 @@ def get_app_root():
app_root = os.path.dirname(basis) app_root = os.path.dirname(basis)
return app_root return app_root
def get_default_config():
config_dict={}
config_dict["homepage"] = CONST_HOMEPAGE_DEFAULT
config_dict["browser"] = "chrome"
config_dict["language"] = "English"
config_dict["ticket_number"] = 2
config_dict['kktix']={}
config_dict["kktix"]["auto_press_next_step_button"] = True
config_dict["kktix"]["auto_fill_ticket_number"] = True
config_dict["kktix"]["area_mode"] = CONST_SELECT_ORDER_DEFAULT
config_dict["kktix"]["area_keyword"] = ""
config_dict["kktix"]["date_keyword"] = ""
config_dict["kktix"]["auto_guess_options"] = True
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"]["area_auto_select"] = {}
config_dict["tixcraft"]["area_auto_select"]["enable"] = True
config_dict["tixcraft"]["area_auto_select"]["area_keyword_1"] = ""
config_dict["tixcraft"]["area_auto_select"]["area_keyword_2"] = ""
config_dict["tixcraft"]["area_auto_select"]["area_keyword_3"] = ""
config_dict["tixcraft"]["area_auto_select"]["area_keyword_4"] = ""
config_dict["tixcraft"]["date_auto_select"]["mode"] = CONST_SELECT_ORDER_DEFAULT
config_dict["tixcraft"]["area_auto_select"]["mode"] = CONST_SELECT_ORDER_DEFAULT
config_dict["tixcraft"]["pass_1_seat_remaining"] = True
config_dict["tixcraft"]["pass_date_is_sold_out"] = False
config_dict["tixcraft"]["auto_reload_coming_soon_page"] = True
config_dict['advanced']={}
config_dict['advanced']['play_captcha_sound']={}
config_dict["advanced"]["play_captcha_sound"]["enable"] = True
config_dict["advanced"]["play_captcha_sound"]["filename"] = CONST_CAPTCHA_SOUND_FILENAME_DEFAULT
config_dict["advanced"]["facebook_account"] = ""
config_dict["advanced"]["adblock_plus_enable"] = False
config_dict['debug']=False
return config_dict
def load_json(): def load_json():
app_root = get_app_root() app_root = get_app_root()
@ -267,21 +307,20 @@ def load_json():
if os.path.isfile(config_filepath): if os.path.isfile(config_filepath):
with open(config_filepath) as json_data: with open(config_filepath) as json_data:
config_dict = json.load(json_data) config_dict = json.load(json_data)
else:
config_dict = get_default_config()
return config_filepath, config_dict return config_filepath, config_dict
def btn_save_clicked(): def btn_save_clicked():
btn_save_act() btn_save_act()
def btn_save_act(slience_mode=False): def btn_save_act(slience_mode=False):
app_root = get_app_root()
config_filepath = os.path.join(app_root, 'settings.json')
is_all_data_correct = True config_dict = get_default_config()
global config_filepath
global config_dict
if not config_dict is None:
# read user input # read user input
global combo_homepage global combo_homepage
global combo_browser global combo_browser
global combo_language global combo_language
@ -316,6 +355,8 @@ def btn_save_act(slience_mode=False):
global txt_captcha_sound_filename global txt_captcha_sound_filename
global chk_state_adblock_plus global chk_state_adblock_plus
is_all_data_correct = True
if is_all_data_correct: if is_all_data_correct:
if combo_homepage.get().strip()=="": if combo_homepage.get().strip()=="":
is_all_data_correct = False is_all_data_correct = False
@ -424,12 +465,10 @@ def btn_run_clicked():
else: else:
interpreter_binary = 'python' interpreter_binary = 'python'
interpreter_binary_alt = 'python3' interpreter_binary_alt = 'python3'
if platform.system() == 'Darwin': if platform.system() == 'Darwin':
# try python3 before python. # try python3 before python.
interpreter_binary = 'python3' interpreter_binary = 'python3'
interpreter_binary_alt = 'python' interpreter_binary_alt = 'python'
print("execute in shell mode.") print("execute in shell mode.")
working_dir = os.path.dirname(os.path.realpath(__file__)) working_dir = os.path.dirname(os.path.realpath(__file__))
#print("script path:", working_dir) #print("script path:", working_dir)
@ -620,6 +659,13 @@ def applyNewLanguage():
lbl_adblock_plus_memo.config(text=translate[language_code]["adblock_plus_memo"]) lbl_adblock_plus_memo.config(text=translate[language_code]["adblock_plus_memo"])
lbl_adblock_plus_settings.config(text=translate[language_code]["adblock_plus_settings"]) lbl_adblock_plus_settings.config(text=translate[language_code]["adblock_plus_settings"])
global btn_run
global btn_save
global btn_exit
btn_run.config(text=translate[language_code]["run"])
btn_save.config(text=translate[language_code]["save"])
btn_exit.config(text=translate[language_code]["exit"])
def callbackHomepageOnChange(event): def callbackHomepageOnChange(event):
showHideBlocks() showHideBlocks()
@ -691,7 +737,6 @@ def showHideBlocks(all_layout_visible=False):
frame_group_tixcraft.grid(column=0, row=frame_group_tixcraft_index, padx=UI_PADDING_X) frame_group_tixcraft.grid(column=0, row=frame_group_tixcraft_index, padx=UI_PADDING_X)
frame_group_kktix.grid_forget() frame_group_kktix.grid_forget()
showHideTixcraftBlocks() showHideTixcraftBlocks()
# purpose: show detail blocks if master field is enable. # purpose: show detail blocks if master field is enable.
@ -785,13 +830,13 @@ def showHideTixcraftBlocks():
def PreferenctTab(root, config_dict, language_code, UI_PADDING_X): def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
homepage = None homepage = CONST_HOMEPAGE_DEFAULT
browser = None browser = "chrome"
language = "English" language = "English"
ticket_number = "2" ticket_number = "2"
auto_press_next_step_button = False # default not checked. auto_press_next_step_button = False
auto_fill_ticket_number = False # default not checked. auto_fill_ticket_number = False
kktix_area_mode = "" kktix_area_mode = ""
kktix_area_keyword = "" kktix_area_keyword = ""
@ -799,7 +844,7 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
# 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 = ""
auto_guess_options = False # default not checked. auto_guess_options = False
date_auto_select_enable = None date_auto_select_enable = None
date_auto_select_mode = "" date_auto_select_mode = ""
@ -812,51 +857,34 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
area_keyword_3 = "" area_keyword_3 = ""
area_keyword_4 = "" area_keyword_4 = ""
pass_1_seat_remaining_enable = False # default not checked. pass_1_seat_remaining_enable = False
pass_date_is_sold_out_enable = False # default not checked. pass_date_is_sold_out_enable = False
auto_reload_coming_soon_page_enable = True # default checked. auto_reload_coming_soon_page_enable = True
debugMode = False debugMode = False
if not config_dict is None:
# read config. # read config.
if u'homepage' in config_dict:
homepage = config_dict["homepage"] homepage = config_dict["homepage"]
if u'browser' in config_dict:
browser = config_dict["browser"] browser = config_dict["browser"]
if u'language' in config_dict:
language = config_dict["language"] language = config_dict["language"]
if u'debug' in config_dict:
debugMode = config_dict["debug"] debugMode = config_dict["debug"]
# default ticket number # default ticket number
# 說明:自動選擇的票數 # 說明:自動選擇的票數
if u'ticket_number' in config_dict:
ticket_number = str(config_dict["ticket_number"]) ticket_number = str(config_dict["ticket_number"])
# for ["kktix"] # for ["kktix"]
if 'kktix' in config_dict:
auto_press_next_step_button = config_dict["kktix"]["auto_press_next_step_button"] auto_press_next_step_button = config_dict["kktix"]["auto_press_next_step_button"]
auto_fill_ticket_number = config_dict["kktix"]["auto_fill_ticket_number"] auto_fill_ticket_number = config_dict["kktix"]["auto_fill_ticket_number"]
if 'area_mode' in config_dict["kktix"]:
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
if 'area_keyword' in config_dict["kktix"]:
kktix_area_keyword = config_dict["kktix"]["area_keyword"].strip() kktix_area_keyword = config_dict["kktix"]["area_keyword"].strip()
if 'date_keyword' in config_dict["kktix"]:
kktix_date_keyword = config_dict["kktix"]["date_keyword"].strip() kktix_date_keyword = config_dict["kktix"]["date_keyword"].strip()
if 'auto_guess_options' in config_dict["kktix"]:
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
# PS: feature disabled.
if 'answer_dictionary' in config_dict["kktix"]: if 'answer_dictionary' in config_dict["kktix"]:
kktix_answer_dictionary = config_dict["kktix"]["answer_dictionary"] kktix_answer_dictionary = config_dict["kktix"]["answer_dictionary"]
if kktix_answer_dictionary is None: if kktix_answer_dictionary is None:
@ -864,52 +892,21 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
kktix_answer_dictionary = kktix_answer_dictionary.strip() kktix_answer_dictionary = kktix_answer_dictionary.strip()
# for ["tixcraft"] # for ["tixcraft"]
if 'tixcraft' in config_dict:
date_auto_select_enable = False
date_auto_select_mode = None
if 'date_auto_select' in config_dict["tixcraft"]:
date_auto_select_enable = config_dict["tixcraft"]["date_auto_select"]["enable"] date_auto_select_enable = config_dict["tixcraft"]["date_auto_select"]["enable"]
date_auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"] date_auto_select_mode = config_dict["tixcraft"]["date_auto_select"]["mode"]
if not date_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY: if not date_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY:
date_auto_select_mode = CONST_SELECT_ORDER_DEFAULT date_auto_select_mode = CONST_SELECT_ORDER_DEFAULT
if 'date_keyword' in config_dict["tixcraft"]["date_auto_select"]:
date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip() date_keyword = config_dict["tixcraft"]["date_auto_select"]["date_keyword"].strip()
area_auto_select_enable = False
area_auto_select_mode = None
if 'area_auto_select' in config_dict["tixcraft"]:
area_auto_select_enable = config_dict["tixcraft"]["area_auto_select"]["enable"] area_auto_select_enable = config_dict["tixcraft"]["area_auto_select"]["enable"]
area_auto_select_mode = config_dict["tixcraft"]["area_auto_select"]["mode"] area_auto_select_mode = config_dict["tixcraft"]["area_auto_select"]["mode"]
if not area_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY: if not area_auto_select_mode in CONST_SELECT_OPTIONS_ARRAY:
area_auto_select_mode = CONST_SELECT_ORDER_DEFAULT area_auto_select_mode = CONST_SELECT_ORDER_DEFAULT
if 'area_keyword_1' in config_dict["tixcraft"]["area_auto_select"]:
area_keyword_1 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_1"].strip() area_keyword_1 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_1"].strip()
if 'area_keyword_2' in config_dict["tixcraft"]["area_auto_select"]:
area_keyword_2 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_2"].strip() area_keyword_2 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_2"].strip()
if 'area_keyword_3' in config_dict["tixcraft"]["area_auto_select"]:
area_keyword_3 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_3"].strip() area_keyword_3 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_3"].strip()
if 'area_keyword_4' in config_dict["tixcraft"]["area_auto_select"]:
area_keyword_4 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_4"].strip() area_keyword_4 = config_dict["tixcraft"]["area_auto_select"]["area_keyword_4"].strip()
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_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"] 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"] auto_reload_coming_soon_page_enable = config_dict["tixcraft"]["auto_reload_coming_soon_page"]
# output config: # output config:
@ -950,8 +947,6 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
print("auto_reload_coming_soon_page", auto_reload_coming_soon_page_enable) print("auto_reload_coming_soon_page", auto_reload_coming_soon_page_enable)
print("debug Mode", debugMode) print("debug Mode", debugMode)
else:
print('config is none')
global lbl_homepage global lbl_homepage
global lbl_browser global lbl_browser
@ -1348,8 +1343,7 @@ def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
facebook_account = "" facebook_account = ""
play_captcha_sound = False play_captcha_sound = False
captcha_sound_filename_default = "ding-dong.wav" captcha_sound_filename = CONST_CAPTCHA_SOUND_FILENAME_DEFAULT
captcha_sound_filename = ""
adblock_plus_enable = False adblock_plus_enable = False
if 'advanced' in config_dict: if 'advanced' in config_dict:
@ -1461,7 +1455,6 @@ def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
lbl_icon_copy.grid(column=3, row=group_row_count, sticky = W+N) lbl_icon_copy.grid(column=3, row=group_row_count, sticky = W+N)
lbl_icon_copy.bind("<Button-1>", lambda e: btn_copy_clicked()) lbl_icon_copy.bind("<Button-1>", lambda e: btn_copy_clicked())
frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X) frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X)
@ -1529,6 +1522,10 @@ def AboutTab(root, language_code):
def get_action_bar(root,language_code): def get_action_bar(root,language_code):
frame_action = Frame(root) frame_action = Frame(root)
global btn_run
global btn_save
global btn_exit
btn_run = ttk.Button(frame_action, text=translate[language_code]['run'], command=btn_run_clicked) btn_run = ttk.Button(frame_action, text=translate[language_code]['run'], command=btn_run_clicked)
btn_run.grid(column=0, row=0) btn_run.grid(column=0, row=0)