2024-03-02, add kktix-status app

master
Your Name 2024-03-14 15:46:26 +08:00
parent a5e240bdb7
commit 0f8867dbca
4 changed files with 760 additions and 23 deletions

View File

@ -41,7 +41,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.03.01)" CONST_APP_VERSION = "MaxBot (2024.03.02)"
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"
@ -111,7 +111,7 @@ CONST_WEBDRIVER_TYPE_SELENIUM = "selenium"
CONST_WEBDRIVER_TYPE_UC = "undetected_chromedriver" CONST_WEBDRIVER_TYPE_UC = "undetected_chromedriver"
CONST_WEBDRIVER_TYPE_DP = "DrissionPage" CONST_WEBDRIVER_TYPE_DP = "DrissionPage"
CONST_CHROME_FAMILY = ["chrome","edge","brave"] CONST_CHROME_FAMILY = ["chrome","edge","brave"]
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
warnings.simplefilter('ignore',InsecureRequestWarning) warnings.simplefilter('ignore',InsecureRequestWarning)
ssl._create_default_https_context = ssl._create_unverified_context ssl._create_default_https_context = ssl._create_unverified_context
@ -4765,7 +4765,7 @@ def kktix_reg_new_main(driver, config_dict, fail_list, played_sound_ticket, is_f
return fail_list, played_sound_ticket return fail_list, played_sound_ticket
def kktix_get_registerStatus(driver, event_code): def kktix_get_registerStatus(event_code):
html_result = None html_result = None
url = "https://kktix.com/g/events/%s/register_info" % (event_code) url = "https://kktix.com/g/events/%s/register_info" % (event_code)
@ -4800,21 +4800,23 @@ def kktix_get_registerStatus(driver, event_code):
#print("registerStatus:", registerStatus) #print("registerStatus:", registerStatus)
return registerStatus return registerStatus
def kktix_check_register_status(driver, url): def kktix_get_event_code(url):
#ex: https://xxx.kktix.cc/events/xxx
prefix_list = ['.com/events/','.cc/events/']
postfix = '/registrations/new'
is_match_event_code = False
event_code = "" event_code = ""
for prefix in prefix_list: if '/registrations/new' in url:
event_code = find_between(url,prefix,postfix) prefix_list = ['.com/events/','.cc/events/']
if len(event_code) > 0: postfix = '/registrations/new'
is_match_event_code = True
#print('event_code:',event_code)
break
if is_match_event_code: for prefix in prefix_list:
event_code = find_between(url,prefix,postfix)
if len(event_code) > 0:
break
#print('event_code:',event_code)
return event_code
def kktix_check_register_status(driver, url):
event_code = kktix_get_event_code(url)
if len(event_code) > 0:
js = ''' js = '''
function load_kktix_register_code(){ function load_kktix_register_code(){
let api_url = "https://kktix.com/g/events/%s/register_info"; let api_url = "https://kktix.com/g/events/%s/register_info";
@ -4850,12 +4852,12 @@ if (typeof $.kkUser.checked_status_register_code === 'undefined') {
except Exception as exc: except Exception as exc:
pass pass
# use javascritp version only.
is_match_event_code = False
registerStatus = None registerStatus = None
# use javascritp version only.
is_match_event_code = False
if is_match_event_code: if is_match_event_code:
kktix_get_registerStatus(driver, event_code) registerStatus = kktix_get_registerStatus(event_code)
return registerStatus return registerStatus
def kktix_reg_auto_reload(driver, url, config_dict): def kktix_reg_auto_reload(driver, url, config_dict):

View File

@ -22,7 +22,7 @@ import sys
import threading import threading
import webbrowser import webbrowser
CONST_APP_VERSION = "MaxBot (2024.03.01)" CONST_APP_VERSION = "MaxBot (2024.03.02)"
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"
@ -544,7 +544,7 @@ def clearFrame(frame):
def load_GUI(root, config_dict): def load_GUI(root, config_dict):
clearFrame(root) clearFrame(root)
language_code="en_us" #language_code="en_us"
language_code = get_language_code_by_name(config_dict["advanced"]["language"]) language_code = get_language_code_by_name(config_dict["advanced"]["language"])
row_count = 0 row_count = 0

735
kktix_status.py Normal file

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.03.01)" CONST_APP_VERSION = "MaxBot (2024.03.02)"
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_CONFIG_FILE = "settings.json"