From fc710a0b4362a499cc9bd0a63785a3f83e19364e Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 27 Nov 2023 18:19:24 +0800 Subject: [PATCH] tixcraft auto reload for coming soon event. --- chrome_tixcraft.py | 48 +++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 54916e8..4bd567f 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -55,7 +55,7 @@ import webbrowser import chromedriver_autoinstaller -CONST_APP_VERSION = "MaxBot (2023.11.20)" +CONST_APP_VERSION = "MaxBot (2023.11.21)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt" @@ -1831,7 +1831,24 @@ def tixcraft_date_auto_select(driver, url, config_dict, domain_name): print("find #gameList fail") is_coming_soon = False - coming_soon_condictions_list_tw = ['開賣','剩餘','天','小時','分鐘','秒','0',':','/'] + coming_soon_condictions_list_en = [' day(s)', ' hrs.',' min',' sec',' till sale starts!','0',':','/'] + coming_soon_condictions_list_tw = ['開賣','剩餘',' 天',' 小時',' 分鐘',' 秒','0',':','/','20'] + coming_soon_condictions_list_ja = ['発売開始', ' 日', ' 時間',' 分',' 秒','0',':','/','20'] + coming_soon_condictions_list = coming_soon_condictions_list_en + html_lang="en-US" + try: + html_body = driver.page_source + if ' 0: + + # check is coming soon events in list. + is_match_all_coming_soon_condiction = True + for condiction_string in coming_soon_condictions_list: + if not condiction_string in row_text: + is_match_all_coming_soon_condiction = False + break + + if is_match_all_coming_soon_condiction: + if show_debug_message: + print("match coming soon condiction at row:", row_text) + is_coming_soon = True + break + row_is_enabled=False for text_item in find_ticket_text_list: if text_item in row_text: @@ -1881,19 +1912,6 @@ def tixcraft_date_auto_select(driver, url, config_dict, domain_name): print("match sold out text: %s, skip this row." % (sold_out_item)) break - # check is coming soon. - if row_is_enabled: - is_match_all_coming_soon_condiction = True - for condiction_string in coming_soon_condictions_list_tw: - if not condiction_string in row_text: - is_match_all_coming_soon_condiction = False - break - if is_match_all_coming_soon_condiction: - if show_debug_message: - print("match coming soon condiction at row:", row_text) - is_coming_soon = True - break - if row_is_enabled: formated_area_list.append(row)