From 614efe9a4ca7bfda719cdabdcdf244f00776fc05 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 8 Mar 2024 12:49:32 +0800 Subject: [PATCH] 2024-02-07, cityline auto click go to purchase --- chrome_tixcraft.py | 3 +- config_launcher.py | 2 +- settings.py | 2 +- .../js/cityline_shows_buy_front.js | 30 +++++++++++++++++++ webdriver/Maxbotplus_1.0.0/manifest.json | 16 +++++++++- 5 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 webdriver/Maxbotplus_1.0.0/js/cityline_shows_buy_front.js diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 17f4a9a..aeaea34 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -41,7 +41,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.02.06)" +CONST_APP_VERSION = "MaxBot (2024.02.07)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" @@ -8497,6 +8497,7 @@ def cityline_main(driver, url, config_dict): # https://www.cityline.com/Login.html?targetUrl=https%3A%2F%2F # ignore url redirect if '/Login.html' in url: + cityline_account = config_dict["advanced"]["cityline_account"] cityline_password = config_dict["advanced"]["cityline_password_plaintext"].strip() if cityline_password == "": cityline_password = decryptMe(config_dict["advanced"]["cityline_password"]) diff --git a/config_launcher.py b/config_launcher.py index 24b9036..b1cc47d 100644 --- a/config_launcher.py +++ b/config_launcher.py @@ -22,7 +22,7 @@ import sys import threading import webbrowser -CONST_APP_VERSION = "MaxBot (2024.02.06)" +CONST_APP_VERSION = "MaxBot (2024.02.07)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/settings.py b/settings.py index a4ad5cc..c8ecb1c 100644 --- a/settings.py +++ b/settings.py @@ -48,7 +48,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.02.06)" +CONST_APP_VERSION = "MaxBot (2024.02.07)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/webdriver/Maxbotplus_1.0.0/js/cityline_shows_buy_front.js b/webdriver/Maxbotplus_1.0.0/js/cityline_shows_buy_front.js new file mode 100644 index 0000000..9e73ae4 --- /dev/null +++ b/webdriver/Maxbotplus_1.0.0/js/cityline_shows_buy_front.js @@ -0,0 +1,30 @@ +var myInterval = null; + +function dom_ready() +{ + let ret=false; + if($("#buyTicketBtn").length>0) { + ret=true; + if(myInterval) clearInterval(myInterval); + + (function () { + console.log($("#buyTicketBtn").length); + if($("#buyTicketBtn").length) { + console.log("clicking"); + $("#buyTicketBtn").trigger("click"); + //go(); + } + })(); + + } + console.log("dom_ready:"+ret); + return ret; +} + +if(!dom_ready()) { + myInterval = setInterval(() => { + dom_ready(); + }, 100); +} + + diff --git a/webdriver/Maxbotplus_1.0.0/manifest.json b/webdriver/Maxbotplus_1.0.0/manifest.json index 2ae9edc..22767ff 100644 --- a/webdriver/Maxbotplus_1.0.0/manifest.json +++ b/webdriver/Maxbotplus_1.0.0/manifest.json @@ -336,6 +336,20 @@ "js/cityline_event_common.js" ] }, + { + "matches": [ + "https://shows.cityline.com/tc/*", + "https://priority.cityline.com/tc/*", + "https://shows.cityline.com/en/*", + "https://priority.cityline.com/en/*" + ], + "run_at": "document_end", + "world": "MAIN", + "js": [ + "jquery.min.js", + "js/cityline_shows_buy_front.js" + ] + }, { "matches": [ "https://ticketplus.com.tw/activity/*" @@ -399,5 +413,5 @@ ] } ], - "version": "1.0.12" + "version": "1.0.14" } \ No newline at end of file