2024-03-16, update for kktix
parent
3c5fba70d7
commit
c43e7c6f80
|
@ -45,7 +45,7 @@ except Exception as exc:
|
||||||
print(exc)
|
print(exc)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.03.15)"
|
CONST_APP_VERSION = "MaxBot (2024.03.16)"
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
@ -23,7 +23,7 @@ import sys
|
||||||
import threading
|
import threading
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.03.15)"
|
CONST_APP_VERSION = "MaxBot (2024.03.16)"
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
@ -11,7 +11,7 @@ import requests
|
||||||
import asyncio
|
import asyncio
|
||||||
import nodriver as uc
|
import nodriver as uc
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.03.15)"
|
CONST_APP_VERSION = "MaxBot (2024.03.16)"
|
||||||
|
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
|
USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
|
||||||
|
|
|
@ -29,7 +29,7 @@ from datetime import datetime
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.03.15)"
|
CONST_APP_VERSION = "MaxBot (2024.03.16)"
|
||||||
|
|
||||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||||
CONST_MAXBOT_KKTIX_CONFIG_FILE = "kktix.json"
|
CONST_MAXBOT_KKTIX_CONFIG_FILE = "kktix.json"
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
"remote_url": "\"http://127.0.0.1:16888/\"",
|
"remote_url": "\"http://127.0.0.1:16888/\"",
|
||||||
"auto_reload_page_interval": 0.1,
|
"auto_reload_page_interval": 0.1,
|
||||||
"reset_browser_interval": 0.0,
|
"reset_browser_interval": 0.0,
|
||||||
|
"max_dwell_time": 120,
|
||||||
"proxy_server_port": "",
|
"proxy_server_port": "",
|
||||||
"window_size": "512,1024",
|
"window_size": "512,1024",
|
||||||
"idle_keyword": "",
|
"idle_keyword": "",
|
||||||
|
|
25
settings.py
25
settings.py
|
@ -50,7 +50,7 @@ try:
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
CONST_APP_VERSION = "MaxBot (2024.03.15)"
|
CONST_APP_VERSION = "MaxBot (2024.03.16)"
|
||||||
|
|
||||||
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"
|
||||||
|
@ -759,7 +759,7 @@ def get_default_config():
|
||||||
|
|
||||||
config_dict["advanced"]["auto_reload_page_interval"] = 0.1
|
config_dict["advanced"]["auto_reload_page_interval"] = 0.1
|
||||||
config_dict["advanced"]["reset_browser_interval"] = 0
|
config_dict["advanced"]["reset_browser_interval"] = 0
|
||||||
config_dict["advanced"]["max_dwell_time"] = 60
|
config_dict["advanced"]["max_dwell_time"] = 120
|
||||||
config_dict["advanced"]["proxy_server_port"] = ""
|
config_dict["advanced"]["proxy_server_port"] = ""
|
||||||
config_dict["advanced"]["window_size"] = "512,1024"
|
config_dict["advanced"]["window_size"] = "512,1024"
|
||||||
|
|
||||||
|
@ -866,6 +866,7 @@ def btn_save_act(slience_mode=False):
|
||||||
global chk_state_pass_date_is_sold_out
|
global chk_state_pass_date_is_sold_out
|
||||||
global chk_state_auto_reload_coming_soon_page
|
global chk_state_auto_reload_coming_soon_page
|
||||||
global txt_auto_reload_page_interval
|
global txt_auto_reload_page_interval
|
||||||
|
global txt_max_dwell_time
|
||||||
global txt_reset_browser_intervalv
|
global txt_reset_browser_intervalv
|
||||||
global txt_proxy_server_port
|
global txt_proxy_server_port
|
||||||
global txt_window_size
|
global txt_window_size
|
||||||
|
@ -1152,10 +1153,15 @@ def btn_save_act(slience_mode=False):
|
||||||
config_dict["advanced"]["auto_guess_options"] = bool(chk_state_auto_guess_options.get())
|
config_dict["advanced"]["auto_guess_options"] = bool(chk_state_auto_guess_options.get())
|
||||||
|
|
||||||
config_dict["advanced"]["auto_reload_page_interval"] = float(txt_auto_reload_page_interval.get().strip())
|
config_dict["advanced"]["auto_reload_page_interval"] = float(txt_auto_reload_page_interval.get().strip())
|
||||||
|
config_dict["advanced"]["max_dwell_time"] = int(txt_max_dwell_time.get().strip())
|
||||||
config_dict["advanced"]["reset_browser_interval"] = float(txt_reset_browser_interval.get().strip())
|
config_dict["advanced"]["reset_browser_interval"] = float(txt_reset_browser_interval.get().strip())
|
||||||
config_dict["advanced"]["proxy_server_port"] = txt_proxy_server_port.get().strip()
|
config_dict["advanced"]["proxy_server_port"] = txt_proxy_server_port.get().strip()
|
||||||
config_dict["advanced"]["window_size"] = txt_window_size.get().strip()
|
config_dict["advanced"]["window_size"] = txt_window_size.get().strip()
|
||||||
|
|
||||||
|
if config_dict["advanced"]["max_dwell_time"] > 0:
|
||||||
|
if config_dict["advanced"]["max_dwell_time"] < 15:
|
||||||
|
config_dict["advanced"]["max_dwell_time"] = 15
|
||||||
|
|
||||||
if config_dict["advanced"]["reset_browser_interval"] > 0:
|
if config_dict["advanced"]["reset_browser_interval"] > 0:
|
||||||
if config_dict["advanced"]["reset_browser_interval"] < 20:
|
if config_dict["advanced"]["reset_browser_interval"] < 20:
|
||||||
# min value is 20 seconds.
|
# min value is 20 seconds.
|
||||||
|
@ -1464,6 +1470,7 @@ def applyNewLanguage():
|
||||||
global lbl_block_facebook_network_recommand
|
global lbl_block_facebook_network_recommand
|
||||||
|
|
||||||
global lbl_auto_reload_page_interval
|
global lbl_auto_reload_page_interval
|
||||||
|
global lbl_max_dwell_time
|
||||||
global lbl_reset_browser_interval
|
global lbl_reset_browser_interval
|
||||||
global lbl_proxy_server_port
|
global lbl_proxy_server_port
|
||||||
global lbl_window_size
|
global lbl_window_size
|
||||||
|
@ -1503,6 +1510,7 @@ def applyNewLanguage():
|
||||||
lbl_block_facebook_network_recommand.config(text=translate[language_code]["recommand_enable"])
|
lbl_block_facebook_network_recommand.config(text=translate[language_code]["recommand_enable"])
|
||||||
|
|
||||||
lbl_auto_reload_page_interval.config(text=translate[language_code]["auto_reload_page_interval"])
|
lbl_auto_reload_page_interval.config(text=translate[language_code]["auto_reload_page_interval"])
|
||||||
|
lbl_max_dwell_time.config(text=translate[language_code]["max_dwell_time"])
|
||||||
lbl_reset_browser_interval.config(text=translate[language_code]["reset_browser_interval"])
|
lbl_reset_browser_interval.config(text=translate[language_code]["reset_browser_interval"])
|
||||||
lbl_proxy_server_port.config(text=translate[language_code]["proxy_server_port"])
|
lbl_proxy_server_port.config(text=translate[language_code]["proxy_server_port"])
|
||||||
lbl_window_size.config(text=translate[language_code]["window_size"])
|
lbl_window_size.config(text=translate[language_code]["window_size"])
|
||||||
|
@ -2152,6 +2160,17 @@ def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
|
||||||
|
|
||||||
group_row_count +=1
|
group_row_count +=1
|
||||||
|
|
||||||
|
global lbl_max_dwell_time
|
||||||
|
lbl_max_dwell_time = Label(frame_group_header, text=translate[language_code]['max_dwell_time'])
|
||||||
|
lbl_max_dwell_time.grid(column=0, row=group_row_count, sticky = E)
|
||||||
|
|
||||||
|
global txt_max_dwell_time
|
||||||
|
txt_max_dwell_time_value = StringVar(frame_group_header, value=config_dict["advanced"]["max_dwell_time"])
|
||||||
|
txt_max_dwell_time = Entry(frame_group_header, width=30, textvariable = txt_max_dwell_time_value)
|
||||||
|
txt_max_dwell_time.grid(column=1, row=group_row_count, sticky = W)
|
||||||
|
|
||||||
|
group_row_count +=1
|
||||||
|
|
||||||
global lbl_reset_browser_interval
|
global lbl_reset_browser_interval
|
||||||
lbl_reset_browser_interval = Label(frame_group_header, text=translate[language_code]['reset_browser_interval'])
|
lbl_reset_browser_interval = Label(frame_group_header, text=translate[language_code]['reset_browser_interval'])
|
||||||
lbl_reset_browser_interval.grid(column=0, row=group_row_count, sticky = E)
|
lbl_reset_browser_interval.grid(column=0, row=group_row_count, sticky = E)
|
||||||
|
@ -3209,7 +3228,7 @@ def main_gui():
|
||||||
load_GUI(root, config_dict)
|
load_GUI(root, config_dict)
|
||||||
|
|
||||||
GUI_SIZE_WIDTH = 580
|
GUI_SIZE_WIDTH = 580
|
||||||
GUI_SIZE_HEIGHT = 610
|
GUI_SIZE_HEIGHT = 640
|
||||||
|
|
||||||
GUI_SIZE_MACOS = str(GUI_SIZE_WIDTH) + 'x' + str(GUI_SIZE_HEIGHT)
|
GUI_SIZE_MACOS = str(GUI_SIZE_WIDTH) + 'x' + str(GUI_SIZE_HEIGHT)
|
||||||
GUI_SIZE_WINDOWS=str(GUI_SIZE_WIDTH-60) + 'x' + str(GUI_SIZE_HEIGHT-70)
|
GUI_SIZE_WINDOWS=str(GUI_SIZE_WIDTH-60) + 'x' + str(GUI_SIZE_HEIGHT-70)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"homepage": "https://tixcraft.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_sound": {"ticket": true, "order": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "facebook_password_plaintext": "", "kktix_password_plaintext": "", "fami_password_plaintext": "", "urbtix_password_plaintext": "", "cityline_password_plaintext": "", "hkticketing_password_plaintext": "", "kham_password_plaintext": "", "ticket_password_plaintext": "", "udn_password_plaintext": "", "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "remote_url": "\"http://127.0.0.1:16888/\"", "auto_reload_page_interval": 0.1, "reset_browser_interval": 0.0, "proxy_server_port": "", "window_size": "512,1024", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}}
|
{"homepage": "https://tixcraft.com", "browser": "chrome", "language": "\u7e41\u9ad4\u4e2d\u6587", "ticket_number": 2, "ocr_captcha": {"enable": true, "beta": true, "force_submit": true, "image_source": "canvas"}, "webdriver_type": "undetected_chromedriver", "date_auto_select": {"enable": true, "date_keyword": "", "mode": "random"}, "area_auto_select": {"enable": true, "mode": "random", "area_keyword": ""}, "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "kktix": {"auto_press_next_step_button": true, "auto_fill_ticket_number": true}, "tixcraft": {"pass_date_is_sold_out": true, "auto_reload_coming_soon_page": true}, "advanced": {"play_sound": {"ticket": true, "order": true, "filename": "ding-dong.wav"}, "tixcraft_sid": "", "ibonqware": "", "facebook_account": "", "kktix_account": "", "fami_account": "", "cityline_account": "", "urbtix_account": "", "hkticketing_account": "", "kham_account": "", "ticket_account": "", "udn_account": "", "ticketplus_account": "", "facebook_password": "", "kktix_password": "", "fami_password": "", "urbtix_password": "", "cityline_password": "", "hkticketing_password": "", "kham_password": "", "ticket_password": "", "udn_password": "", "ticketplus_password": "", "facebook_password_plaintext": "", "kktix_password_plaintext": "", "fami_password_plaintext": "", "urbtix_password_plaintext": "", "cityline_password_plaintext": "", "hkticketing_password_plaintext": "", "kham_password_plaintext": "", "ticket_password_plaintext": "", "udn_password_plaintext": "", "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, "hide_some_image": true, "block_facebook_network": false, "headless": false, "verbose": false, "auto_guess_options": true, "user_guess_string": "", "remote_url": "\"http://127.0.0.1:16888/\"", "auto_reload_page_interval": 0.1, "reset_browser_interval": 0.0, "max_dwell_time": 120, "proxy_server_port": "", "window_size": "512,1024", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}}
|
|
@ -161,9 +161,15 @@ function kktix_force_auto_reload_by_timer()
|
||||||
if(settings) {
|
if(settings) {
|
||||||
//console.log("auto reload for kktix");
|
//console.log("auto reload for kktix");
|
||||||
if(settings.advanced.kktix_account.length > 0) {
|
if(settings.advanced.kktix_account.length > 0) {
|
||||||
|
let auto_reload_time = 120;
|
||||||
|
if(settings.advanced.max_dwell_time >= 10) {
|
||||||
|
auto_reload_time = settings.advanced.max_dwell_time;
|
||||||
|
}
|
||||||
|
//console.log("max_dwell_time:" + auto_reload_time);
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
location.reload();;
|
location.reload();;
|
||||||
}, 45 * 1000);
|
}, auto_reload_time * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue