2024-04-16, remove some features.

master
Your Name 2024-05-11 12:23:43 +08:00
parent 56d5b2440b
commit b7a6204e84
16 changed files with 88 additions and 234 deletions

View File

@ -44,7 +44,7 @@ except Exception as exc:
print(exc) print(exc)
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.15)" CONST_APP_VERSION = "MaxBot (2024.04.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"
@ -115,7 +115,7 @@ CONST_WEBDRIVER_TYPE_UC = "undetected_chromedriver"
CONST_WEBDRIVER_TYPE_DP = "DrissionPage" CONST_WEBDRIVER_TYPE_DP = "DrissionPage"
CONST_WEBDRIVER_TYPE_NODRIVER = "nodriver" CONST_WEBDRIVER_TYPE_NODRIVER = "nodriver"
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/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/124.0.0.0 Safari/537.36"
CONST_PREFS_DICT = { CONST_PREFS_DICT = {
"credentials_enable_service": False, "credentials_enable_service": False,
"in_product_help.snoozed_feature.IPH_LiveCaption.is_dismissed": True, "in_product_help.snoozed_feature.IPH_LiveCaption.is_dismissed": True,

View File

@ -24,7 +24,7 @@ import webbrowser
import util import util
CONST_APP_VERSION = "MaxBot (2024.04.15)" CONST_APP_VERSION = "MaxBot (2024.04.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"

View File

@ -32,7 +32,7 @@ except Exception as exc:
print(exc) print(exc)
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.15)" CONST_APP_VERSION = "MaxBot (2024.04.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"
@ -98,7 +98,7 @@ CONST_OCR_CAPTCH_IMAGE_SOURCE_CANVAS = "canvas"
CONST_WEBDRIVER_TYPE_NODRIVER = "nodriver" CONST_WEBDRIVER_TYPE_NODRIVER = "nodriver"
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/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/124.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

View File

@ -12,19 +12,18 @@
"webdriver_type": "undetected_chromedriver", "webdriver_type": "undetected_chromedriver",
"date_auto_select": { "date_auto_select": {
"enable": true, "enable": true,
"date_keyword": "\"\"", "date_keyword": "",
"mode": "random" "mode": "random"
}, },
"area_auto_select": { "area_auto_select": {
"enable": true, "enable": true,
"mode": "random", "mode": "random",
"area_keyword": "\"\"" "area_keyword": ""
}, },
"keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"", "keyword_exclude": "\"\u8f2a\u6905\",\"\u8eab\u969c\",\"\u8eab\u5fc3 \u969c\u7919\",\"Restricted View\",\"\u71c8\u67f1\u906e\u853d\",\"\u8996\u7dda\u4e0d\u5b8c\u6574\"",
"kktix": { "kktix": {
"auto_press_next_step_button": true, "auto_press_next_step_button": true,
"auto_fill_ticket_number": true, "auto_fill_ticket_number": true,
"kktix_status_api": false,
"max_dwell_time": 60 "max_dwell_time": 60
}, },
"cityline": { "cityline": {
@ -79,7 +78,7 @@
"headless": false, "headless": false,
"verbose": false, "verbose": false,
"auto_guess_options": true, "auto_guess_options": true,
"user_guess_string": "\"\"", "user_guess_string": "",
"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, "reset_browser_interval": 0,

View File

@ -39,7 +39,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.15)" CONST_APP_VERSION = "MaxBot (2024.04.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"
@ -125,7 +125,6 @@ def get_default_config():
config_dict['kktix']={} config_dict['kktix']={}
config_dict["kktix"]["auto_press_next_step_button"] = True config_dict["kktix"]["auto_press_next_step_button"] = True
config_dict["kktix"]["auto_fill_ticket_number"] = True config_dict["kktix"]["auto_fill_ticket_number"] = True
config_dict["kktix"]["kktix_status_api"] = False
config_dict["kktix"]["max_dwell_time"] = 60 config_dict["kktix"]["max_dwell_time"] = 60
config_dict['cityline']={} config_dict['cityline']={}
@ -186,6 +185,8 @@ def get_default_config():
config_dict["advanced"]["verbose"] = False config_dict["advanced"]["verbose"] = False
config_dict["advanced"]["auto_guess_options"] = True config_dict["advanced"]["auto_guess_options"] = True
config_dict["advanced"]["user_guess_string"] = "" config_dict["advanced"]["user_guess_string"] = ""
# remote_url not under ocr, due to not only support ocr features.
config_dict["advanced"]["remote_url"] = "\"http://127.0.0.1:%d/\"" % (CONST_SERVER_PORT) config_dict["advanced"]["remote_url"] = "\"http://127.0.0.1:%d/\"" % (CONST_SERVER_PORT)
config_dict["advanced"]["auto_reload_page_interval"] = 0.1 config_dict["advanced"]["auto_reload_page_interval"] = 0.1
@ -288,17 +289,14 @@ def launch_maxbot():
else: else:
launch_counter = 0 launch_counter = 0
#webdriver_type = "" config_filepath, config_dict = load_json()
webdriver_type = CONST_WEBDRIVER_TYPE_NODRIVER config_dict = decrypt_password(config_dict)
#webdriver_type = combo_webdriver_type.get().strip()
script_name = "chrome_tixcraft" script_name = "chrome_tixcraft"
if webdriver_type == CONST_WEBDRIVER_TYPE_NODRIVER: if config_dict["webdriver_type"] == CONST_WEBDRIVER_TYPE_NODRIVER:
script_name = "nodriver_tixcraft" script_name = "nodriver_tixcraft"
#global txt_window_size window_size = config_dict["advanced"]["window_size"]
#window_size = txt_window_size.get().strip()
window_size = "480,1024"
if len(window_size) > 0: if len(window_size) > 0:
if "," in window_size: if "," in window_size:
size_array = window_size.split(",") size_array = window_size.split(",")

View File

@ -34,7 +34,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.15)" CONST_APP_VERSION = "MaxBot (2024.04.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"

View File

@ -18,7 +18,7 @@ CONST_FROM_BOTTOM_TO_TOP = "from bottom to top"
CONST_CENTER = "center" CONST_CENTER = "center"
CONST_RANDOM = "random" CONST_RANDOM = "random"
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/124.0.0.0 Safari/537.36"
def get_ip_address(): def get_ip_address():
gethostname = None gethostname = None

View File

@ -1 +1 @@
{"homepage": "about:blank", "browser": "chrome", "language": "English", "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, "kktix_status_api": false, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": 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": false, "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, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}, "domain_filter": ["*.doubleclick.net/*", "*.googlesyndication.com/*", "*.ssp.hinet.net/*", "*a.amnet.tw/*", "*anymind360.com/*", "*adx.c.appier.net/*", "*cdn.cookielaw.org/*", "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*", "*clarity.ms/*", "*cloudfront.com/*", "*cms.analytics.yahoo.com/*", "*e2elog.fetnet.net/*", "*fundingchoicesmessages.google.com/*", "*ghtinc.com/*", "*google-analytics.com/*", "*googletagmanager.com/*", "*googletagservices.com/*", "*img.uniicreative.com/*", "*lndata.com/*", "*match.adsrvr.org/*", "*onead.onevision.com.tw/*", "*play.google.com/log?*", "*popin.cc/*", "*rollbar.com/*", "*sb.scorecardresearch.com/*", "*tagtoo.co/*", "*ticketmaster.sg/js/adblock*", "*ticketmaster.sg/js/adblock.js*", "*tixcraft.com/js/analytics.js*", "*tixcraft.com/js/common.js*", "*tixcraft.com/js/custom.js*", "*treasuredata.com/*", "*www.youtube.com/youtubei/v1/player/heartbeat*"]} {"homepage": "https://kktix.com/events/keswlkfo1/registrations/new", "browser": "chrome", "language": "English", "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, "kktix_status_api": false, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": 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": true, "hide_some_image": true, "block_facebook_network": true, "headless": true, "verbose": true, "auto_guess_options": true, "user_guess_string": "\"\"", "remote_url": "\"http://maxbot.dropboxlike.com:16888/\"", "auto_reload_page_interval": 0.1, "reset_browser_interval": 0, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}, "domain_filter": ["*.doubleclick.net/*", "*.googlesyndication.com/*", "*.ssp.hinet.net/*", "*a.amnet.tw/*", "*adx.c.appier.net/*", "*cdn.cookielaw.org/*", "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*", "*clarity.ms/*", "*cloudfront.com/*", "*cms.analytics.yahoo.com/*", "*e2elog.fetnet.net/*", "*fundingchoicesmessages.google.com/*", "*ghtinc.com/*", "*google-analytics.com/*", "*googletagmanager.com/*", "*googletagservices.com/*", "*img.uniicreative.com/*", "*lndata.com/*", "*match.adsrvr.org/*", "*onead.onevision.com.tw/*", "*play.google.com/log?*", "*popin.cc/*", "*rollbar.com/*", "*sb.scorecardresearch.com/*", "*tagtoo.co/*", "*ticketmaster.sg/js/adblock*", "*ticketmaster.sg/js/adblock.js*", "*tixcraft.com/js/analytics.js*", "*tixcraft.com/js/common.js*", "*tixcraft.com/js/custom.js*", "*treasuredata.com/*", "*www.youtube.com/youtubei/v1/player/heartbeat*"]}

View File

@ -1,13 +1,63 @@
body { body {
margin: 36px; margin: 36px;
} }
textarea { textarea {
font-family: monospace; font-family: monospace;
} }
.message { .message {
height: 20px; height: 20px;
background: #eee; background: #eee;
padding: 5px; padding: 5px;
}
.disappear {
display: none;
}
.bd-callout {
padding: 1.25rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
color: var(--bd-callout-color, inherit);
background-color: var(--bd-callout-bg, var(--bs-gray-100));
border-left: 0.25rem solid var(--bd-callout-border, var(--bs-gray-300))
}
.bd-callout h4 {
margin-bottom: .25rem
}
.bd-callout code {
font-size: var(--bs-body-font-size);
}
.bd-callout>:last-child {
margin-bottom: 0
}
.bd-callout+.bd-callout {
margin-top: -.25rem
}
.bd-callout .highlight {
background-color: rgba(0,0,0,0.05)
}
.bd-callout-info {
--bd-callout-color: var(--bs-info-text-emphasis);
--bd-callout-border: var(--bs-info-border-subtle)
}
.bd-callout-warning {
--bd-callout-color: var(--bs-warning-text-emphasis);
--bd-callout-bg: var(--bs-warning-bg-subtle);
--bd-callout-border: var(--bs-warning-border-subtle)
}
.bd-callout-danger {
--bd-callout-color: var(--bs-danger-text-emphasis);
--bd-callout-bg: var(--bs-danger-bg-subtle);
--bd-callout-border: var(--bs-danger-border-subtle)
} }

View File

@ -1 +1 @@
{"homepage": "about:blank", "browser": "chrome", "language": "English", "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, "kktix_status_api": false, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": 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": false, "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, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}} {"homepage": "https://kktix.com/events/keswlkfo1/registrations/new", "browser": "chrome", "language": "English", "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, "kktix_status_api": false, "max_dwell_time": 60}, "cityline": {"cityline_queue_retry": 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": true, "hide_some_image": true, "block_facebook_network": true, "headless": true, "verbose": true, "auto_guess_options": true, "user_guess_string": "\"\"", "remote_url": "\"http://maxbot.dropboxlike.com:16888/\"", "auto_reload_page_interval": 0.1, "reset_browser_interval": 0, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}}

View File

@ -43,7 +43,7 @@ function kktix_agree()
}); });
} }
function kktix_area_keyword(settings, base_info, register_info) function kktix_area_keyword(settings)
{ {
let area_keyword_array = []; let area_keyword_array = [];
if(settings) { if(settings) {
@ -88,11 +88,7 @@ function kktix_area_keyword(settings, base_info, register_info)
if(link_id) { if(link_id) {
let seat_inventory_key=link_id.split("_")[1]; let seat_inventory_key=link_id.split("_")[1];
//console.log("seat_inventory_key:"+seat_inventory_key); //console.log("seat_inventory_key:"+seat_inventory_key);
let seat_inventory_number=register_info.inventory.seatInventory[seat_inventory_key];
let ticket_number = settings.ticket_number; let ticket_number = settings.ticket_number;
if(seat_inventory_number<ticket_number) {
ticket_number=seat_inventory_number;
}
if(ticket_number>0) { if(ticket_number>0) {
/* /*
@ -111,28 +107,6 @@ function kktix_area_keyword(settings, base_info, register_info)
//console.log(base_info); //console.log(base_info);
let is_verification_conditions_popup = false; let is_verification_conditions_popup = false;
if(base_info && base_info.eventData.hasOwnProperty("order_qualifications")) {
//console.log(base_info.eventData.order_qualifications.length);
for (let i = 0; i < base_info.eventData.order_qualifications.length; i++) {
let rs = base_info.eventData.order_qualifications[i];
//console.log(rs);
for(let j=0; j < rs.conditions.length; j++) {
let rs_j = JSON.parse(rs.conditions[j]);
//console.log(rs_j);
if(rs_j.hasOwnProperty("ticket_ids")) {
//console.log(rs_j.ticket_ids.length);
for(let k=0; k < rs_j.ticket_ids.length; k++) {
let rs_k = rs_j.ticket_ids[k]
//console.log(rs_k);
if(""+rs_k==seat_inventory_key) {
is_verification_conditions_popup = true;
}
}
}
}
}
}
let add_button = target_area.find('button[ng-click="quantityBtnClick(1)"]'); let add_button = target_area.find('button[ng-click="quantityBtnClick(1)"]');
for(let i=0; i<ticket_number; i++) { for(let i=0; i<ticket_number; i++) {
@ -183,15 +157,10 @@ function kktix_area_keyword(settings, base_info, register_info)
function begin() function begin()
{ {
let settings = JSON.parse($("#settings").html()); let settings = JSON.parse($("#settings").html());
let base_info = JSON.parse($("#base_info").html());
let register_info = JSON.parse($("#register_info").html());
$("#settings").remove(); $("#settings").remove();
$("#base_info").remove();
$("#register_info").remove();
//console.log(settings); //console.log(settings);
//console.log(register_info);
kktix_area_keyword(settings, base_info, register_info); //kktix_area_keyword(settings);
} }
function dom_ready() function dom_ready()

View File

@ -29,146 +29,6 @@ function kktix_clean_exclude(settings)
} }
} }
function clean_sold_out_row(register_info, base_info)
{
//console.log("clean_sold_out_row");
let match_target = false;
for (var key in register_info.inventory.ticketInventory) {
if(register_info.inventory.ticketInventory[key]) {
//console.log("key:"+key);
if($("#ticket_"+key).length) {
match_target = true;
break;
}
}
}
//console.log("match_target:"+match_target);
if(match_target) {
$("footer").remove();
$("div.banner-wrapper").remove();
$("div.ticket-img-wrapper").remove();
$("span.ticket-quantity[ng-if=\"!purchasableAndSelectable\"]").each(function ()
{
$(this).parent().parent().parent().remove();
});
clearInterval(myInterval);
if(settings) {
let settings_div="<div style='display:none' id='settings'>" + JSON.stringify(settings) + "</div>";
$("body").append(settings_div);
let register_info_div="<div style='display:none' id='register_info'>" + JSON.stringify(register_info) + "</div>";
$("body").append(register_info_div);
let base_info_div="<div style='display:none' id='base_info'>" + JSON.stringify(base_info) + "</div>";
$("body").append(base_info_div);
kktix_clean_exclude(settings);
//kktix_area_keyword(settings, register_info);
}
}
}
function kktix_ajax_return_base_info(base_info, register_info)
{
//console.log(base_info.eventData.order_qualifications);
$(function() {
myInterval = setInterval(() => {
clean_sold_out_row(register_info, base_info);
}, 200);
});
}
function kktix_ajax_return_register_info(register_info)
{
let reload=false;
//console.log(register_info.inventory.registerStatus);
// IN_STOCK
if(register_info.inventory.registerStatus=='OUT_OF_STOCK') {reload=true;}
if(register_info.inventory.registerStatus=='COMING_SOON') {reload=true;}
if(register_info.inventory.registerStatus=='SOLD_OUT') {reload=true;}
//console.log(reload);
if(reload) {
let auto_reload_page_interval = 0.0;
if(settings) {
auto_reload_page_interval = settings.advanced.auto_reload_page_interval;
}
// memory not able to release soon.
if (auto_reload_page_interval < 0.23) {
auto_reload_page_interval = 0.23;
}
const rootElement = document.documentElement;
rootElement.remove();
register_info=null;
settings = null;
myInterval = null;
for (var key in window) {
key=null;
delete key;
}
if(auto_reload_page_interval == 0) {
//console.log('Start to reload now.');
window.location.reload();
} else {
//console.log('We are going to reload after few seconeds.');
setTimeout(function () {
window.location.reload();
}, auto_reload_page_interval * 1000);
}
}
else {
kktix_event_base_info(register_info);
kktix_force_auto_reload_by_timer();
}
}
function kktix_event_base_info(register_info)
{
const currentUrl = window.location.href;
const event_code = currentUrl.split('/')[4];
//console.log(currentUrl);
//console.log(event_code);
if(event_code){
let api_url = "https://kktix.com/g/events/"+ event_code +"/base_info";
$.get( api_url, function() {
//alert( "success" );
})
.done(function(data) {
//alert( "second success" );
kktix_ajax_return_base_info(data, register_info);
})
.fail(function() {
//alert( "error" );
})
.always(function() {
//alert( "finished" );
});
}
}
function kktix_event_register_info()
{
const currentUrl = window.location.href;
const event_code = currentUrl.split('/')[4];
//console.log(currentUrl);
//console.log(event_code);
if(event_code){
let api_url = "https://kktix.com/g/events/"+ event_code +"/register_info";
$.get( api_url, function() {
//alert( "success" );
})
.done(function(data) {
//alert( "second success" );
kktix_ajax_return_register_info(data);
})
.fail(function() {
//alert( "error" );
})
.always(function() {
//alert( "finished" );
});
}
}
function kktix_force_auto_reload_by_timer() function kktix_force_auto_reload_by_timer()
{ {
@ -202,15 +62,11 @@ storage.get('status', function (items)
{ {
if (items.status && items.status=='ON') if (items.status && items.status=='ON')
{ {
let kktix_status_api = false;
if(settings) { kktix_force_auto_reload_by_timer();
kktix_status_api = settings.kktix.kktix_status_api; setTimeout(function () {
} kktix_clean_exclude(settings);
if(kktix_status_api) { }, 500);
kktix_event_register_info();
} else {
kktix_force_auto_reload_by_timer();
}
} else { } else {
//console.log('maxbot status is not ON'); //console.log('maxbot status is not ON');
} }

View File

@ -166,12 +166,6 @@
<input class="form-check-input" type="checkbox" id="auto_press_next_step_button" /> <input class="form-check-input" type="checkbox" id="auto_press_next_step_button" />
</div> </div>
</div> </div>
<div class="row mb-3">
<label class="col-sm-2 col-form-label form-check-label" for="kktix_status_api">KKTIX購票狀態API</label>
<div class="col-sm-10">
<input class="form-check-input" type="checkbox" id="kktix_status_api" />
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<label for="max_dwell_time" class="col-sm-2 col-form-label">KKTIX購票最長停留(秒)</label> <label for="max_dwell_time" class="col-sm-2 col-form-label">KKTIX購票最長停留(秒)</label>
<div class="col-sm-10"> <div class="col-sm-10">

View File

@ -9,7 +9,6 @@ const area_keyword = document.querySelector('#area_keyword');
const keyword_exclude = document.querySelector('#keyword_exclude'); const keyword_exclude = document.querySelector('#keyword_exclude');
const auto_reload_page_interval = document.querySelector('#auto_reload_page_interval'); const auto_reload_page_interval = document.querySelector('#auto_reload_page_interval');
const auto_press_next_step_button = document.querySelector('#auto_press_next_step_button'); const auto_press_next_step_button = document.querySelector('#auto_press_next_step_button');
const kktix_status_api = document.querySelector('#kktix_status_api');
const max_dwell_time = document.querySelector('#max_dwell_time'); const max_dwell_time = document.querySelector('#max_dwell_time');
const disable_adjacent_seat = document.querySelector('#disable_adjacent_seat'); const disable_adjacent_seat = document.querySelector('#disable_adjacent_seat');
const ocr_captcha_enable = document.querySelector('#ocr_captcha_enable'); const ocr_captcha_enable = document.querySelector('#ocr_captcha_enable');
@ -62,8 +61,7 @@ async function saveChanges()
settings.advanced.auto_reload_page_interval = auto_reload_page_interval.value; settings.advanced.auto_reload_page_interval = auto_reload_page_interval.value;
settings.kktix.auto_press_next_step_button = auto_press_next_step_button.checked; settings.kktix.auto_press_next_step_button = auto_press_next_step_button.checked;
settings.advanced.kktix_status_api = kktix_status_api.checked; settings.kktix.max_dwell_time = max_dwell_time.value;
settings.advanced.max_dwell_time = max_dwell_time.value;
settings.advanced.disable_adjacent_seat = disable_adjacent_seat.checked; settings.advanced.disable_adjacent_seat = disable_adjacent_seat.checked;
settings.ocr_captcha.enable = ocr_captcha_enable.checked; settings.ocr_captcha.enable = ocr_captcha_enable.checked;
@ -115,8 +113,7 @@ function loadChanges()
keyword_exclude.value = settings.keyword_exclude; keyword_exclude.value = settings.keyword_exclude;
auto_reload_page_interval.value = settings.advanced.auto_reload_page_interval; auto_reload_page_interval.value = settings.advanced.auto_reload_page_interval;
auto_press_next_step_button.checked = settings.kktix.auto_press_next_step_button; auto_press_next_step_button.checked = settings.kktix.auto_press_next_step_button;
kktix_status_api.checked = settings.advanced.kktix_status_api; max_dwell_time.value = settings.kktix.max_dwell_time;
max_dwell_time.value = settings.advanced.max_dwell_time;
disable_adjacent_seat.checked = settings.advanced.disable_adjacent_seat; disable_adjacent_seat.checked = settings.advanced.disable_adjacent_seat;
ocr_captcha_enable.checked = settings.ocr_captcha.enable; ocr_captcha_enable.checked = settings.ocr_captcha.enable;

View File

@ -116,12 +116,6 @@
<input class="form-check-input" type="checkbox" id="auto_press_next_step_button" /> <input class="form-check-input" type="checkbox" id="auto_press_next_step_button" />
</div> </div>
</div> </div>
<div class="row mb-3 disappear" data-under="kktix">
<label class="col-sm-2 col-form-label form-check-label" for="kktix_status_api">KKTIX購票狀態API</label>
<div class="col-sm-10">
<input class="form-check-input" type="checkbox" id="kktix_status_api" />
</div>
</div>
<div class="row mb-3 disappear" data-under="kktix"> <div class="row mb-3 disappear" data-under="kktix">
<label for="max_dwell_time" class="col-sm-2 col-form-label">KKTIX購票最長停留(秒)</label> <label for="max_dwell_time" class="col-sm-2 col-form-label">KKTIX購票最長停留(秒)</label>
<div class="col-sm-10"> <div class="col-sm-10">
@ -540,7 +534,7 @@
<!-- tab 6 --> <!-- tab 6 -->
<div class="tab-pane fade" id="runtime-tab-pane" role="tabpanel" aria-labelledby="runtime-tab" tabindex="2"> <div class="tab-pane fade" id="runtime-tab-pane" role="tabpanel" aria-labelledby="runtime-tab" tabindex="2">
<div class="row mb-3"> <div class="row mb-3">
<label for="maxbot_status" class="col-sm-2 col-form-label">執行狀態</label> <label class="col-sm-2 col-form-label">執行狀態</label>
<div class="col-sm-10"> <div class="col-sm-10">
<span id="maxbot_status"></span> <span id="maxbot_status"></span>
<button class="btn btn-primary" id="pause_btn">暫停搶票</button> <button class="btn btn-primary" id="pause_btn">暫停搶票</button>
@ -556,7 +550,7 @@
</div> </div>
<div class="row mb-3"> <div class="row mb-3">
<label for="maxbot_status" class="col-sm-2 col-form-label">系統時間</label> <label class="col-sm-2 col-form-label">系統時間</label>
<div class="col-sm-10"> <div class="col-sm-10">
<span id="system_time"></span> <span id="system_time"></span>
</div> </div>

View File

@ -24,7 +24,6 @@ const play_order_sound = document.querySelector('#play_order_sound');
const play_sound_filename = document.querySelector('#play_sound_filename'); const play_sound_filename = document.querySelector('#play_sound_filename');
const auto_press_next_step_button = document.querySelector('#auto_press_next_step_button'); const auto_press_next_step_button = document.querySelector('#auto_press_next_step_button');
const kktix_status_api = document.querySelector('#kktix_status_api');
const max_dwell_time = document.querySelector('#max_dwell_time'); const max_dwell_time = document.querySelector('#max_dwell_time');
const cityline_queue_retry = document.querySelector('#cityline_queue_retry'); const cityline_queue_retry = document.querySelector('#cityline_queue_retry');
@ -117,7 +116,6 @@ function load_settins_to_form(settings)
play_sound_filename.value = settings.advanced.play_sound.filename; play_sound_filename.value = settings.advanced.play_sound.filename;
auto_press_next_step_button.checked = settings.kktix.auto_press_next_step_button; auto_press_next_step_button.checked = settings.kktix.auto_press_next_step_button;
kktix_status_api.checked = settings.kktix.kktix_status_api;
max_dwell_time.value = settings.kktix.max_dwell_time; max_dwell_time.value = settings.kktix.max_dwell_time;
cityline_queue_retry.checked = settings.cityline.cityline_queue_retry; cityline_queue_retry.checked = settings.cityline.cityline_queue_retry;
@ -242,7 +240,7 @@ function maxbot_reset_api()
}); });
} }
async function checkUsePublicServer() function checkUsePublicServer()
{ {
if(ocr_captcha_enable.checked) { if(ocr_captcha_enable.checked) {
remote_url.value = PUBLIC_SERVER_URL; remote_url.value = PUBLIC_SERVER_URL;
@ -351,7 +349,6 @@ function save_changes_to_dict(silent_flag)
settings.advanced.play_sound.filename = play_sound_filename.value; settings.advanced.play_sound.filename = play_sound_filename.value;
settings.kktix.auto_press_next_step_button = auto_press_next_step_button.checked; settings.kktix.auto_press_next_step_button = auto_press_next_step_button.checked;
settings.kktix.kktix_status_api = kktix_status_api.checked;
settings.kktix.max_dwell_time = parseInt(max_dwell_time.value); settings.kktix.max_dwell_time = parseInt(max_dwell_time.value);
settings.cityline.cityline_queue_retry = cityline_queue_retry.checked; settings.cityline.cityline_queue_retry = cityline_queue_retry.checked;