2024-03-18, change some default value.
parent
0aff21fd06
commit
7b9a933941
|
@ -45,7 +45,7 @@ except Exception as exc:
|
|||
print(exc)
|
||||
pass
|
||||
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.17)"
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.18)"
|
||||
|
||||
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||
|
@ -114,7 +114,7 @@ CONST_OCR_CAPTCH_IMAGE_SOURCE_CANVAS = "canvas"
|
|||
CONST_WEBDRIVER_TYPE_SELENIUM = "selenium"
|
||||
CONST_WEBDRIVER_TYPE_UC = "undetected_chromedriver"
|
||||
CONST_WEBDRIVER_TYPE_DP = "DrissionPage"
|
||||
CONST_WEBDRIVER_TYPE_ND = "nodriver"
|
||||
CONST_WEBDRIVER_TYPE_NODRIVER = "nodriver"
|
||||
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"
|
||||
|
||||
|
@ -1015,6 +1015,12 @@ def get_driver_by_config(config_dict):
|
|||
NETWORK_BLOCKED_URLS.append('*.azureedge.net/QWARE_TICKET//images/*')
|
||||
NETWORK_BLOCKED_URLS.append('*static.ticketplus.com.tw/event/*')
|
||||
|
||||
NETWORK_BLOCKED_URLS.append('https://kktix.cc/change_locale?locale=*')
|
||||
NETWORK_BLOCKED_URLS.append('https://t.kfs.io/assets/logo_*.png')
|
||||
NETWORK_BLOCKED_URLS.append('https://t.kfs.io/assets/icon-*.png')
|
||||
NETWORK_BLOCKED_URLS.append('https://t.kfs.io/upload_images/*.jpg')
|
||||
|
||||
|
||||
if config_dict["advanced"]["block_facebook_network"]:
|
||||
NETWORK_BLOCKED_URLS.append('*facebook.com/*')
|
||||
NETWORK_BLOCKED_URLS.append('*.fbcdn.net/*')
|
||||
|
|
|
@ -23,7 +23,7 @@ import sys
|
|||
import threading
|
||||
import webbrowser
|
||||
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.17)"
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.18)"
|
||||
|
||||
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
|
||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||
|
|
|
@ -11,7 +11,7 @@ import requests
|
|||
import asyncio
|
||||
import nodriver as uc
|
||||
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.17)"
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.18)"
|
||||
|
||||
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"
|
||||
|
|
|
@ -29,7 +29,7 @@ from datetime import datetime
|
|||
|
||||
import requests
|
||||
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.17)"
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.18)"
|
||||
|
||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||
CONST_MAXBOT_KKTIX_CONFIG_FILE = "kktix.json"
|
||||
|
|
|
@ -76,9 +76,9 @@
|
|||
"auto_guess_options": true,
|
||||
"user_guess_string": "",
|
||||
"remote_url": "\"http://127.0.0.1:16888/\"",
|
||||
"auto_reload_page_interval": 0.1,
|
||||
"auto_reload_page_interval": 0.05,
|
||||
"reset_browser_interval": 0.0,
|
||||
"max_dwell_time": 120,
|
||||
"max_dwell_time": 60,
|
||||
"proxy_server_port": "",
|
||||
"window_size": "512,1024",
|
||||
"idle_keyword": "",
|
||||
|
|
24
settings.py
24
settings.py
|
@ -50,7 +50,7 @@ try:
|
|||
except Exception as exc:
|
||||
pass
|
||||
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.17)"
|
||||
CONST_APP_VERSION = "MaxBot (2024.03.18)"
|
||||
|
||||
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
||||
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
||||
|
@ -78,6 +78,7 @@ CONST_OCR_CAPTCH_IMAGE_SOURCE_CANVAS = "canvas"
|
|||
CONST_WEBDRIVER_TYPE_SELENIUM = "selenium"
|
||||
CONST_WEBDRIVER_TYPE_UC = "undetected_chromedriver"
|
||||
CONST_WEBDRIVER_TYPE_DP = "DrissionPage"
|
||||
CONST_WEBDRIVER_TYPE_NODRIVER = "nodriver"
|
||||
|
||||
CONST_SUPPORTED_SITES = ["https://kktix.com"
|
||||
,"https://tixcraft.com (拓元)"
|
||||
|
@ -757,9 +758,9 @@ def get_default_config():
|
|||
config_dict["advanced"]["user_guess_string"] = ""
|
||||
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.05
|
||||
config_dict["advanced"]["reset_browser_interval"] = 0
|
||||
config_dict["advanced"]["max_dwell_time"] = 120
|
||||
config_dict["advanced"]["max_dwell_time"] = 60
|
||||
config_dict["advanced"]["proxy_server_port"] = ""
|
||||
config_dict["advanced"]["window_size"] = "512,1024"
|
||||
|
||||
|
@ -2041,6 +2042,19 @@ def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
|
|||
showHideAreaBlocks()
|
||||
|
||||
def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
|
||||
browser_options = ("chrome","firefox","edge","safari","brave")
|
||||
webdriver_type_options = (CONST_WEBDRIVER_TYPE_SELENIUM, CONST_WEBDRIVER_TYPE_UC)
|
||||
|
||||
not_support_python_version = ["3.7.","3.8."]
|
||||
is_current_version_after_3_9 = True
|
||||
for ver in not_support_python_version:
|
||||
if ver in platform.python_version():
|
||||
is_current_version_after_3_9 = False
|
||||
break
|
||||
if is_current_version_after_3_9:
|
||||
#webdriver_type_options = (CONST_WEBDRIVER_TYPE_SELENIUM, CONST_WEBDRIVER_TYPE_UC, CONST_WEBDRIVER_TYPE_NODRIVER)
|
||||
pass
|
||||
|
||||
row_count = 0
|
||||
|
||||
frame_group_header = Frame(root)
|
||||
|
@ -2059,7 +2073,7 @@ def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
|
|||
|
||||
global combo_browser
|
||||
combo_browser = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
||||
combo_browser['values']= ("chrome","firefox","edge","safari","brave")
|
||||
combo_browser['values']= browser_options
|
||||
combo_browser.set(config_dict['browser'])
|
||||
combo_browser.grid(column=1, row=group_row_count, sticky = W)
|
||||
|
||||
|
@ -2096,7 +2110,7 @@ def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
|
|||
|
||||
global combo_webdriver_type
|
||||
combo_webdriver_type = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
||||
combo_webdriver_type['values']= (CONST_WEBDRIVER_TYPE_SELENIUM, CONST_WEBDRIVER_TYPE_UC)
|
||||
combo_webdriver_type['values']= webdriver_type_options
|
||||
combo_webdriver_type.set(config_dict["webdriver_type"])
|
||||
combo_webdriver_type.grid(column=1, row=group_row_count, sticky = W)
|
||||
|
||||
|
|
|
@ -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": ""}, "domain_filter": ["*google-analytics.com/*", "*googletagmanager.com/*", "*googletagservices.com/*", "*lndata.com/*", "*a.amnet.tw/*", "*adx.c.appier.net/*", "*clarity.ms/*", "*cloudfront.com/*", "*cms.analytics.yahoo.com/*", "*doubleclick.net/*", "*e2elog.fetnet.net/*", "*fundingchoicesmessages.google.com/*", "*ghtinc.com/*", "*match.adsrvr.org/*", "*onead.onevision.com.tw/*", "*popin.cc/*", "*rollbar.com/*", "*sb.scorecardresearch.com/*", "*tagtoo.co/*", "*.ssp.hinet.net/*", "*ticketmaster.sg/js/adblock*", "*.googlesyndication.com/*", "*treasuredata.com/*", "*play.google.com/log?*", "*www.youtube.com/youtubei/v1/player/heartbeat*", "*tixcraft.com/js/analytics.js*", "*ticketmaster.sg/js/adblock.js*", "*img.uniicreative.com/*", "*cdn.cookielaw.org/*", "*tixcraft.com/js/custom.js*", "*tixcraft.com/js/common.js*", "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*"]}
|
||||
{"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.05, "reset_browser_interval": 0.0, "max_dwell_time": 60, "proxy_server_port": "", "window_size": "512,1024", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}, "domain_filter": ["*google-analytics.com/*", "*googletagmanager.com/*", "*googletagservices.com/*", "*lndata.com/*", "*a.amnet.tw/*", "*adx.c.appier.net/*", "*clarity.ms/*", "*cloudfront.com/*", "*cms.analytics.yahoo.com/*", "*doubleclick.net/*", "*e2elog.fetnet.net/*", "*fundingchoicesmessages.google.com/*", "*ghtinc.com/*", "*match.adsrvr.org/*", "*onead.onevision.com.tw/*", "*popin.cc/*", "*rollbar.com/*", "*sb.scorecardresearch.com/*", "*tagtoo.co/*", "*.ssp.hinet.net/*", "*ticketmaster.sg/js/adblock*", "*.googlesyndication.com/*", "*treasuredata.com/*", "*play.google.com/log?*", "*www.youtube.com/youtubei/v1/player/heartbeat*", "*tixcraft.com/js/analytics.js*", "*ticketmaster.sg/js/adblock.js*", "*img.uniicreative.com/*", "*cdn.cookielaw.org/*", "*tixcraft.com/js/custom.js*", "*tixcraft.com/js/common.js*", "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*"]}
|
|
@ -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, "max_dwell_time": 120, "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.05, "reset_browser_interval": 0.0, "max_dwell_time": 60, "proxy_server_port": "", "window_size": "512,1024", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}}
|
|
@ -85,8 +85,8 @@ function begin()
|
|||
}
|
||||
|
||||
// too short to cause error.
|
||||
if(auto_reload_page_interval < 0.1) {
|
||||
auto_reload_page_interval = 0.1;
|
||||
if(auto_reload_page_interval < 0.05) {
|
||||
auto_reload_page_interval = 0.05;
|
||||
}
|
||||
|
||||
if(status=='ON') {
|
||||
|
|
|
@ -14,8 +14,8 @@ function begin()
|
|||
}
|
||||
|
||||
// too short to cause error.
|
||||
if(auto_reload_page_interval < 0.8) {
|
||||
auto_reload_page_interval = 0.8;
|
||||
if(auto_reload_page_interval < 0.5) {
|
||||
auto_reload_page_interval = 0.5;
|
||||
}
|
||||
|
||||
if(status=='ON') {
|
||||
|
|
|
@ -93,6 +93,9 @@ function kktix_ajax_return_register_info(register_info)
|
|||
if(settings) {
|
||||
auto_reload_page_interval = settings.advanced.auto_reload_page_interval;
|
||||
}
|
||||
const rootElement = document.documentElement;
|
||||
rootElement.remove();
|
||||
delete window;
|
||||
if(auto_reload_page_interval == 0) {
|
||||
//console.log('Start to reload now.');
|
||||
location.reload();
|
||||
|
@ -161,15 +164,17 @@ function kktix_force_auto_reload_by_timer()
|
|||
if(settings) {
|
||||
//console.log("auto reload for kktix");
|
||||
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;
|
||||
let max_dwell_time = 120;
|
||||
if(settings) {
|
||||
max_dwell_time = settings.advanced.max_dwell_time;
|
||||
}
|
||||
//console.log("max_dwell_time:" + auto_reload_time);
|
||||
|
||||
setInterval(() => {
|
||||
location.reload();;
|
||||
}, auto_reload_time * 1000);
|
||||
if(max_dwell_time <= 10) {
|
||||
max_dwell_time = 10;
|
||||
}
|
||||
console.log('We are going to reload after few seconeds.');
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, max_dwell_time * 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,13 +18,6 @@ function get_event_status_entry(real_event_id, real_session_id) {
|
|||
function ajax_return_done(data, real_event_id, real_session_id) {
|
||||
//console.log("ajax return done")
|
||||
let reload=false;
|
||||
|
||||
let auto_reload_page_interval = 0.0;
|
||||
if(settings) {
|
||||
auto_reload_page_interval = settings.advanced.auto_reload_page_interval;
|
||||
}
|
||||
//console.log("auto_reload_page_interval:"+auto_reload_page_interval);
|
||||
|
||||
if(data.result.session[0].status=="pending" || data.result.session[0].status=="soldout" || data.result.session[0].status=="unavailable") {
|
||||
reload=true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue