2023-01-02, update for MaxBot Plus extension.

master
unknown 2024-01-10 10:58:03 +08:00
parent a124d6b896
commit dd53d05209
14 changed files with 201 additions and 44 deletions

View File

@ -54,7 +54,7 @@ import webbrowser
import chromedriver_autoinstaller
CONST_APP_VERSION = "MaxBot (2024.01.01)"
CONST_APP_VERSION = "MaxBot (2024.01.02)"
CONST_MAXBOT_CONFIG_FILE = "settings.json"
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"
@ -871,6 +871,7 @@ def get_driver_by_config(config_dict):
,'*googletagservices.*'
,'*play.google.com/*'
,'*.googlesyndication.com/*'
,'*cdn.cookielaw.org/*'
,'*fundingchoicesmessages.google.com/*'
,'*.doubleclick.net/*'
,'*.rollbar.com/*'
@ -8141,7 +8142,8 @@ def urbtix_main(driver, url, config_dict):
pass
pass
# 刷太快, 會被封IP?
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
if config_dict["advanced"]["auto_reload_page_interval"] > 0:
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
if '/logout?' in url:
try:
@ -8253,7 +8255,8 @@ def cityline_auto_retry_access(driver, config_dict):
pass
# 刷太快, 會被封IP?
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
if config_dict["advanced"]["auto_reload_page_interval"] > 0:
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
def cityline_go_venue(driver, url):
url_https = url.replace("http://","https://")
@ -8638,7 +8641,7 @@ def ibon_captcha(driver, config_dict, ocr, Captcha_Browser, model_name):
is_captcha_sent = False
previous_answer = None
last_url, is_quit_bot = get_current_url(driver)
for redo_ocr in range(999):
for redo_ocr in range(19):
is_need_redo_ocr, previous_answer, is_form_sumbited = ibon_auto_ocr(driver, config_dict, ocr, away_from_keyboard_enable, previous_answer, Captcha_Browser, ocr_captcha_image_source, model_name)
# TODO: must ensure the answer is corrent...
@ -9613,7 +9616,8 @@ def hkticketing_url_redirect(driver, url, config_dict):
pass
# 刷太快, 會被封IP?
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
if config_dict["advanced"]["auto_reload_page_interval"] > 0:
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
if is_redirected:
break
@ -9695,7 +9699,8 @@ def hkticketing_content_refresh(driver, url, config_dict):
pass
# 刷太快, 會被封IP?
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
if config_dict["advanced"]["auto_reload_page_interval"] > 0:
time.sleep(config_dict["advanced"]["auto_reload_page_interval"])
return is_redirected

View File

@ -22,7 +22,7 @@ import sys
import threading
import webbrowser
CONST_APP_VERSION = "MaxBot (2024.01.01)"
CONST_APP_VERSION = "MaxBot (2024.01.02)"
CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json"
CONST_MAXBOT_CONFIG_FILE = "settings.json"

View File

@ -34,7 +34,7 @@ import ssl
ssl._create_default_https_context = ssl._create_unverified_context
CONST_APP_VERSION = "MaxBot (2024.01.01)"
CONST_APP_VERSION = "MaxBot (2024.01.02)"
CONST_MAXBOT_CONFIG_FILE = "settings.json"
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"

View File

@ -27,7 +27,7 @@ import pyperclip
import tornado
from tornado.web import Application
CONST_APP_VERSION = "MaxBot (2024.01.01)"
CONST_APP_VERSION = "MaxBot (2024.01.02)"
CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt"

View File

@ -0,0 +1,2 @@
// TODO: ...
console.log("TODO: date auto click...");

View File

@ -0,0 +1,65 @@
const storage = chrome.storage.local;
var settings = null;
$("footer").remove();
function assign_ticket_number(ticket_number)
{
let $main_table = $("table.table");
if ($main_table.length > 0)
{
console.log("found main table");
let $ticket_options = $main_table.find("select:first option");
if ($ticket_options.length)
{
let is_ticket_number_assign = false;
if (ticket_number > 0)
{
console.log("target ticket_number:"+ticket_number);
$ticket_options.each(function ()
{
if ($(this).val() == ticket_number)
{
$(this).prop('selected', true);
is_ticket_number_assign = true;
return false;
}
}
);
}
console.log("is_ticket_number_assign:"+is_ticket_number_assign);
if (!is_ticket_number_assign)
{
$ticket_options.last().prop('selected', true);
}
}
}
}
function assign_adjacent_seat(flag) {
//console.log("disable_adjacent_seat flag:"+flag);
if(flag) {
$('input[type=checkbox]').each(function() {
$(this).prop('checked', true);
});
}
}
function focus_on_captcha()
{
$("div.editor-box > div > input[type='text']").focus();
}
storage.get('settings', function (items)
{
if (items.settings)
{
settings = items.settings;
//console.log("ticket_number:"+ settings.ticket_number);
assign_ticket_number(settings.ticket_number);
assign_adjacent_seat(settings.advanced.disable_adjacent_seat);
focus_on_captcha();
} else {
console.log('no settings found');
}
});

View File

@ -1,3 +1,6 @@
$("div#DIV_REMARK").remove();
$("div.footer").remove();
$a_btn=$("#content").find("table.eventTABLE > tbody > tr > td > a > button[onclick]");
if($a_btn.length==1) {
$a_btn.click();

View File

@ -0,0 +1,5 @@
$("div#dialog-message").remove();
$("div#ad3").remove();
$("div#buyTicket").remove();
$("div#marquee").remove();
$("div.footer").remove();

View File

@ -0,0 +1,5 @@
$("div.headlines").remove();
$("section.app-intro").remove();
$("section.copywriting").remove();
$("section.partner-venues").remove();
$("footer").remove();

View File

@ -0,0 +1,2 @@
$("#footer").remove();
$("footer").remove();

View File

@ -90,6 +90,11 @@
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/tixcraft_ticket.js" ]
},
{
"matches" : [ "https://ticket.com.tw/application/utk01/utk0101_.aspx" ],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/ticket_home.js" ]
},
{
"matches" : [ "https://ticket.com.tw/application/UTK02/UTK0201_.aspx?PRODUCT_ID=*" ],
"run_at": "document_end",
@ -107,6 +112,11 @@
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/common.js", "js/ticket_area.js" ]
},
{
"matches" : [ "https://kham.com.tw/application/utk01/UTK0101_03.aspx" ],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/kham_home.js" ]
},
{
"matches" : [ "https://kham.com.tw/application/UTK02/UTK0201_.aspx?PRODUCT_ID=*" ],
"run_at": "document_end",
@ -114,7 +124,9 @@
"js" : [ "jquery.min.js", "js/kham_event_home.js" ]
},
{
"matches" : [ "https://kham.com.tw/application/UTK02/UTK0201_00.aspx?PRODUCT_ID=*" ],
"matches" : [
"https://kham.com.tw/application/UTK02/UTK0201_00.aspx?PRODUCT_ID=*"
],
"run_at": "document_end",
"world": "MAIN",
"js" : [ "jquery.min.js", "js/kham_date.js" ]
@ -124,11 +136,21 @@
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/kham_area.js" ]
},
{
"matches" : [ "https://ticket.ibon.com.tw/ActivityInfo/Details/*" ],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/ibon_detail.js" ]
},
{
"matches" : [ "https://orders.ibon.com.tw/application/UTK02/UTK0201_000.aspx?*" ],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/ibon_area.js" ]
},
{
"matches" : [ "https://orders.ibon.com.tw/application/UTK02/UTK0201_001.aspx?PERFORMANCE_ID=*PERFORMANCE_PRICE_AREA_ID=*" ],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/ibon_ticket.js" ]
},
{
"matches" : [
"https://msg.cityline.com/*.html*"
@ -138,7 +160,7 @@
},
{
"matches" : [
"https://msg.cityline.com/*.html*"
"https://msg.cityline.com/*"
],
"run_at": "document_end",
"world": "MAIN",
@ -166,6 +188,13 @@
"run_at": "document_start",
"js" : [ "jquery.min.js", "js/ticketplus_order.js"]
},
{
"matches" : [
"https://kktix.com/"
],
"run_at": "document_end",
"js" : [ "jquery.min.js", "js/kktix_home.js" ]
},
{
"matches" : [
"https://*.kktix.cc/events/*"

View File

@ -67,6 +67,15 @@
<input class="form-control" id="auto_reload_page_interval" value="" />
</div>
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="disable_adjacent_seat">
<label class="form-check-label" for="disable_adjacent_seat">
Disable Adjacent Seat
</label>
</div>
</div>
<div class="col-12">
<button class="btn btn-primary" id="save_btn">Save</button>
</div>

View File

@ -8,6 +8,8 @@ const area_select_mode = document.querySelector('#area_select_mode');
const area_keyword = document.querySelector('#area_keyword');
const keyword_exclude = document.querySelector('#keyword_exclude');
const auto_reload_page_interval = document.querySelector('#auto_reload_page_interval');
const disable_adjacent_seat = document.querySelector('#disable_adjacent_seat');
var settings = null;
loadChanges();
@ -30,6 +32,7 @@ async function saveChanges()
settings.area_auto_select.area_keyword = area_keyword.value;
settings.keyword_exclude = keyword_exclude.value;
settings.advanced.auto_reload_page_interval = auto_reload_page_interval.value;
settings.advanced.disable_adjacent_seat = disable_adjacent_seat.checked;
await storage.set(
{
@ -57,6 +60,7 @@ function loadChanges()
area_keyword.value = settings.area_auto_select.area_keyword;
keyword_exclude.value = settings.keyword_exclude;
auto_reload_page_interval.value = settings.advanced.auto_reload_page_interval;
disable_adjacent_seat.checked = settings.advanced.disable_adjacent_seat;
//message('Loaded saved settings.');
} else {
console.log('no settings found');

View File

@ -5,7 +5,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*google-analytics.com/*",
"resourceTypes": ["main_frame", "sub_frame"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -14,7 +14,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*googletagmanager.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -23,7 +23,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*googletagservices.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -32,7 +32,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*lndata.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -41,7 +41,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*a.amnet.tw/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -50,7 +50,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*ad.setn.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -59,7 +59,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*adx.c.appier.net/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -77,7 +77,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*clarity.ms/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -104,7 +104,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*doubleclick.net/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -113,7 +113,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*e2elog.fetnet.net/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -122,7 +122,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*fundingchoicesmessages.google.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -131,7 +131,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*ghtinc.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -140,7 +140,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*match.adsrvr.org/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -149,7 +149,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*onead.onevision.com.tw/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -158,7 +158,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*popin.cc/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -167,7 +167,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*rollbar.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -176,16 +176,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*sb.scorecardresearch.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
}
},
{
"id": 21,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*t.ssp.hinet.net/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -194,7 +185,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*tagtoo.co/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -202,8 +193,8 @@
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*t.ssp.hinet.net/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"urlFilter": "*.ssp.hinet.net/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -220,8 +211,8 @@
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*tpc.googlesyndication.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"urlFilter": "*.googlesyndication.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -230,7 +221,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*treasuredata.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -239,7 +230,7 @@
"action": { "type": "block"},
"condition": {
"urlFilter": "*ubas.setn.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
@ -286,5 +277,42 @@
"urlFilter": "*img.uniicreative.com/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
}
},
{
"id": 33,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*cdn.cookielaw.org/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
},
{
"id": 34,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*tixcraft.com/js/custom.js*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
}
},
{
"id": 35,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*tixcraft.com/js/common.js*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media"]
}
},
{
"id": 36,
"priority": 1,
"action": { "type": "block"},
"condition": {
"urlFilter": "*cdnjs.cloudflare.com/ajax/libs/clipboard.js/*",
"resourceTypes": ["main_frame", "sub_frame", "script", "image", "font", "xmlhttprequest", "media", "stylesheet"]
}
}
]