From 40e9873af45ee5b32cc1e03c42d5e028898cd61c Mon Sep 17 00:00:00 2001 From: CHUN YU YAO Date: Sun, 24 Mar 2024 20:30:48 +0800 Subject: [PATCH] 2024-03-08, bugfix for kktix. --- chrome_tixcraft.py | 21 ++++++++++++++++--- config_launcher.py | 2 +- kktix_status.py | 2 +- settings.py | 2 +- .../Maxbotplus_1.0.0/js/cityline_msg_front.js | 4 ++-- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 2135b66..955d66f 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -42,7 +42,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.03.07)" +CONST_APP_VERSION = "MaxBot (2024.03.08)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" @@ -4613,7 +4613,7 @@ def set_kktix_control_label_text(driver, config_dict): if not answer_item in fail_list: inferred_answer_string = answer_item break - input_text_css = 'div > div.code-input > div.control-group > div.controls > label > input[type="text"]' + input_text_css = 'div > div.code-input > div.control-group > div.controls > label[ng-if] > input[type="text"]' next_step_button_css = '#registrationsNewApp div.form-actions button.btn-primary' submit_by_enter = False check_input_interval = 0.2 @@ -4737,17 +4737,32 @@ def kktix_reg_new_main(driver, config_dict, fail_list, played_sound_ticket, is_f play_sound_while_ordering(config_dict) played_sound_ticket = True + # whole event question. fail_list, is_question_popup = kktix_reg_captcha(driver, config_dict, fail_list, is_finish_checkbox_click, registrationsNewApp_div) + + # single option question if not is_question_popup: # no captcha text popup, goto next page. control_text = get_kktix_control_label_text(driver) if show_debug_message: print("control_text:", control_text) + if len(control_text) == 0: click_ret = kktix_press_next_button(driver) else: - #set_kktix_control_label_text(driver, config_dict) # input by maxbox plus extension. + is_fill_at_webdriver = False + + if not config_dict["browser"] in CONST_CHROME_FAMILY: + is_fill_at_webdriver = True + else: + if not config_dict["advanced"]["chrome_extension"]: + is_fill_at_webdriver = True + + # TODO: not implement in extension, so force to fill in webdriver. + is_fill_at_webdriver = True + if is_fill_at_webdriver: + set_kktix_control_label_text(driver, config_dict) pass else: if is_need_refresh: diff --git a/config_launcher.py b/config_launcher.py index 9529c92..9f2d112 100644 --- a/config_launcher.py +++ b/config_launcher.py @@ -23,7 +23,7 @@ import sys import threading import webbrowser -CONST_APP_VERSION = "MaxBot (2024.03.07)" +CONST_APP_VERSION = "MaxBot (2024.03.08)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/kktix_status.py b/kktix_status.py index 05ebfc4..b2999fa 100644 --- a/kktix_status.py +++ b/kktix_status.py @@ -29,7 +29,7 @@ from datetime import datetime import requests -CONST_APP_VERSION = "MaxBot (2024.03.07)" +CONST_APP_VERSION = "MaxBot (2024.03.08)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_KKTIX_CONFIG_FILE = "kktix.json" diff --git a/settings.py b/settings.py index d541de6..f22ad9f 100644 --- a/settings.py +++ b/settings.py @@ -50,7 +50,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.03.07)" +CONST_APP_VERSION = "MaxBot (2024.03.08)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/webdriver/Maxbotplus_1.0.0/js/cityline_msg_front.js b/webdriver/Maxbotplus_1.0.0/js/cityline_msg_front.js index eb95392..40795dd 100644 --- a/webdriver/Maxbotplus_1.0.0/js/cityline_msg_front.js +++ b/webdriver/Maxbotplus_1.0.0/js/cityline_msg_front.js @@ -15,8 +15,8 @@ function begin() } // too short to cause error. - if(auto_reload_page_interval < 0.6) { - auto_reload_page_interval = 0.6; + if(auto_reload_page_interval < 0.2) { + auto_reload_page_interval = 0.2; } if(status=='ON') {