2024-04-19, update for fantopia

master
Your Name 2024-06-20 20:30:44 +08:00
parent 3ebbb31620
commit 64bfa63cbf
12 changed files with 123 additions and 21 deletions

View File

@ -44,7 +44,7 @@ except Exception as exc:
print(exc) print(exc)
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.18)" CONST_APP_VERSION = "MaxBot (2024.04.19)"
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"
@ -600,6 +600,7 @@ def get_driver_by_config(config_dict):
homepage = config_dict["homepage"] homepage = config_dict["homepage"]
# output config: # output config:
print("current time:", datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
print("maxbot app version:", CONST_APP_VERSION) print("maxbot app version:", CONST_APP_VERSION)
print("python version:", platform.python_version()) print("python version:", platform.python_version())
print("platform:", platform.platform()) print("platform:", platform.platform())

View File

@ -24,7 +24,7 @@ import webbrowser
import util import util
CONST_APP_VERSION = "MaxBot (2024.04.18)" CONST_APP_VERSION = "MaxBot (2024.04.19)"
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.18)" CONST_APP_VERSION = "MaxBot (2024.04.19)"
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"
@ -490,6 +490,8 @@ async def nodriver_kktix_travel_price_list(tab, config_dict, kktix_area_auto_sel
row_text = "" row_text = ""
if not row_input is None: if not row_input is None:
is_match_area = False
# check ticket input textbox. # check ticket input textbox.
if len(current_ticket_number) > 0: if len(current_ticket_number) > 0:
if current_ticket_number != "0": if current_ticket_number != "0":

View File

@ -39,7 +39,7 @@ try:
except Exception as exc: except Exception as exc:
pass pass
CONST_APP_VERSION = "MaxBot (2024.04.18)" CONST_APP_VERSION = "MaxBot (2024.04.19)"
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

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

@ -1 +1 @@
{"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*"]} {"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, "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,1", "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 +1 @@
{"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": ""}} {"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, "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,1", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}}

View File

@ -0,0 +1,43 @@
const storage = chrome.storage.local;
var settings = null;
var inputInterval = null;
function fantopia_fill_main(settings) {
if(settings.ticket_number) {
let current_ticket_number = parseInt($("input.border-0").val());
for(let i=0; i<settings.ticket_number; i++) {
current_ticket_number = parseInt($("input.border-0").val());
if(current_ticket_number >= settings.ticket_number) break;
$('button > img[src="https://p-st.fantopia.io/icon/add.svg"]').click();
}
// check overflow
current_ticket_number = parseInt($("input.border-0").val());
if(current_ticket_number > settings.ticket_number) {
$('button > img[src="https://p-st.fantopia.io/icon/reduce.svg"]').click();
} else {
if(current_ticket_number == settings.ticket_number) {
$('div.border-t > div.text-right > button.relative > div.flex.items-center.justify-center').click();
}
}
}
}
storage.get('settings', function (items)
{
if (items.settings)
{
settings = items.settings;
}
});
storage.get('status', function (items)
{
if (items.status && items.status=='ON')
{
inputInterval= setInterval(() => {
fantopia_fill_main(settings);
}, 200);
} else {
//console.log('maxbot status is not ON');
}
});

View File

@ -465,7 +465,18 @@
"jquery.min.js", "jquery.min.js",
"js/hncb_fill.js" "js/hncb_fill.js"
] ]
} },
{
"matches": [
"https://fantopia.io/events-tickets?eventsKey=*"
], ],
"version": "1.0.26" "run_at": "document_end",
"js": [
"jquery.min.js",
"js/fantopia_fill.js"
]
}
],
"version": "1.0.27"
} }

BIN
www/.DS_Store vendored

Binary file not shown.

View File

@ -226,7 +226,7 @@
<textarea class="form-control" id="area_keyword" rows="3"></textarea> <textarea class="form-control" id="area_keyword" rows="3"></textarea>
</div> </div>
</div> </div>
<div class="row mb-3"> <div class="row">
<label for="keyword_exclude" class="col-sm-2 col-form-label">排除關鍵字</label> <label for="keyword_exclude" class="col-sm-2 col-form-label">排除關鍵字</label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea class="form-control" id="keyword_exclude" rows="3"></textarea> <textarea class="form-control" id="keyword_exclude" rows="3"></textarea>
@ -236,6 +236,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<label for="homepage" class="col-sm-2 col-form-label">版本</label>
<div class="col-sm-10"><p id="maxbot_version" class="text-secondary mt-2"></p>
</div>
</div>
</div> </div>
<!-- tab 3 --> <!-- tab 3 -->
@ -601,6 +606,9 @@
<button class="btn btn-primary" id="reset_btn">重設為預設值</button> <button class="btn btn-primary" id="reset_btn">重設為預設值</button>
<button class="btn btn-danger" id="exit_btn">結束</button> <button class="btn btn-danger" id="exit_btn">結束</button>
</div> </div>
<div class="col-12">
<span class="text-danger" id="run_btn_pressed_message"></span>
</div>
</div> </div>
<div class="modal" id="message_modal" tabindex="-1" role="dialog"> <div class="modal" id="message_modal" tabindex="-1" role="dialog">

View File

@ -270,6 +270,7 @@ function message_old(msg)
function maxbot_launch() function maxbot_launch()
{ {
run_message("啟動 MaxBot 主程式中...");
save_changes_to_dict(true); save_changes_to_dict(true);
maxbot_save_api(maxbot_run_api()); maxbot_save_api(maxbot_run_api());
} }
@ -579,6 +580,10 @@ function check_unsaved_fields()
if(special_site.length) { if(special_site.length) {
$('div[data-under="'+ special_site +'"]').removeClass("disappear"); $('div[data-under="'+ special_site +'"]').removeClass("disappear");
} }
// for cityline.
if(homepage.value.indexOf("cityline.com") > 0) {
$("#webdriver_type").val("nodriver");
}
} }
} }
} }
@ -613,6 +618,23 @@ function maxbot_status_api()
}); });
} }
function maxbot_version_api()
{
let api_url = "http://127.0.0.1:16888/version";
$.get( api_url, function() {
//alert( "success" );
})
.done(function(data) {
$("#maxbot_version").html(data.version);
})
.fail(function() {
//alert( "error" );
})
.always(function() {
//alert( "finished" );
});
}
function update_system_time() function update_system_time()
{ {
var currentdate = new Date(); var currentdate = new Date();
@ -627,6 +649,8 @@ var status_interval= setInterval(() => {
update_system_time(); update_system_time();
}, 500); }, 500);
maxbot_version_api();
run_button.addEventListener('click', maxbot_launch); run_button.addEventListener('click', maxbot_launch);
save_button.addEventListener('click', maxbot_save); save_button.addEventListener('click', maxbot_save);
reset_button.addEventListener('click', maxbot_reset_api); reset_button.addEventListener('click', maxbot_reset_api);
@ -644,3 +668,16 @@ onchange_tag_list.forEach((tag) => {
}); });
homepage.addEventListener('keyup', check_unsaved_fields); homepage.addEventListener('keyup', check_unsaved_fields);
let runMessageClearTimer;
function run_message(msg)
{
clearTimeout(runMessageClearTimer);
const message = document.querySelector('#run_btn_pressed_message');
message.innerText = msg;
messageClearTimer = setTimeout(function ()
{
message.innerText = '';
}, 3000);
}