From ce2d337b1b879a999ecd35002320f40d19075a7c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 8 Apr 2024 19:11:20 +0800 Subject: [PATCH] 2024-03-28, slow down KKTIX to like a human. --- chrome_tixcraft.py | 16 +++++++++++--- config_launcher.py | 2 +- kktix_status.py | 2 +- nodriver_tixcraft.py | 21 ++++++++++++++++--- settings.json | 4 ++-- settings.py | 4 ++-- .../Maxblockplus_1.0.0/data/settings.json | 2 +- webdriver/Maxbotplus_1.0.0/data/settings.json | 2 +- .../js/kktix_registrations_reload.js | 6 ++++-- 9 files changed, 43 insertions(+), 16 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 5d88d79..50f3dcd 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -44,7 +44,7 @@ except Exception as exc: print(exc) pass -CONST_APP_VERSION = "MaxBot (2024.03.27)" +CONST_APP_VERSION = "MaxBot (2024.03.28)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" @@ -762,7 +762,7 @@ 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://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') @@ -779,6 +779,12 @@ def get_driver_by_config(config_dict): if 'kktix.c' in homepage: if len(config_dict["advanced"]["kktix_account"])>0: + # for like human. + try: + driver.get(homepage) + time.sleep(5) + except Exception as e: + pass if not 'https://kktix.com/users/sign_in?' in homepage: homepage = CONST_KKTIX_SIGN_IN_URL % (homepage) @@ -5297,6 +5303,9 @@ def facebook_login(driver, account, password): def kktix_login(driver, account, password): ret = False + # for like human. + time.sleep(5) + el_email = None try: el_email = driver.find_element(By.CSS_SELECTOR, '#user_login') @@ -6110,7 +6119,8 @@ def kktix_main(driver, url, config_dict, kktix_dict): if '/registrations/new' in url: kktix_dict["start_time"] = time.time() - kktix_reg_auto_reload(driver, url, config_dict) + # call api, cuase add access log. DISABLE it. + # kktix_reg_auto_reload(driver, url, config_dict) is_dom_ready = False is_finish_checkbox_click = False diff --git a/config_launcher.py b/config_launcher.py index 2851fd7..be5ea5e 100644 --- a/config_launcher.py +++ b/config_launcher.py @@ -24,7 +24,7 @@ import webbrowser import util -CONST_APP_VERSION = "MaxBot (2024.03.27)" +CONST_APP_VERSION = "MaxBot (2024.03.28)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/kktix_status.py b/kktix_status.py index 3ad3e89..2a692c5 100644 --- a/kktix_status.py +++ b/kktix_status.py @@ -29,7 +29,7 @@ from datetime import datetime import util -CONST_APP_VERSION = "MaxBot (2024.03.27)" +CONST_APP_VERSION = "MaxBot (2024.03.28)" CONST_MAXBOT_CONFIG_FILE = "settings.json" CONST_MAXBOT_KKTIX_CONFIG_FILE = "kktix.json" diff --git a/nodriver_tixcraft.py b/nodriver_tixcraft.py index c0c09a3..8880af8 100644 --- a/nodriver_tixcraft.py +++ b/nodriver_tixcraft.py @@ -243,6 +243,9 @@ async def nodriver_facebook_login(tab, facebook_account, facebook_password): async def nodriver_kktix_signin(tab, url, config_dict): + # for like human. + time.sleep(5) + kktix_account = config_dict["advanced"]["kktix_account"] kktix_password = config_dict["advanced"]["kktix_password_plaintext"].strip() if kktix_password == "": @@ -274,6 +277,14 @@ async def nodriver_kktix_paused_main(tab, url, config_dict, kktix_dict): async def nodriver_goto_homepage(driver, config_dict): homepage = config_dict["homepage"] if 'kktix.c' in homepage: + # for like human. + try: + tab = await driver.get(homepage) + time.sleep(5) + except Exception as e: + pass + + if len(config_dict["advanced"]["kktix_account"])>0: if not 'https://kktix.com/users/sign_in?' in homepage: homepage = CONST_KKTIX_SIGN_IN_URL % (homepage) @@ -306,8 +317,11 @@ async def nodriver_goto_homepage(driver, config_dict): if len(config_dict["advanced"]["ticketplus_account"]) > 1: homepage = "https://ticketplus.com.tw/" - tab = await driver.get(homepage) - time.sleep(1) + try: + tab = await driver.get(homepage) + time.sleep(3) + except Exception as e: + pass tixcraft_family = False if 'tixcraft.com' in homepage: @@ -1732,7 +1746,7 @@ async def nodrver_block_urls(tab, 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://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') @@ -1762,6 +1776,7 @@ async def nodriver_current_url(tab): exit_bot_error_strings = [ "server rejected WebSocket connection: HTTP 500", "[Errno 61] Connect call failed ('127.0.0.1',", + "[WinError 1225] ", ] url = "" diff --git a/settings.json b/settings.json index 9a50050..b24379f 100644 --- a/settings.json +++ b/settings.json @@ -69,14 +69,14 @@ "ticketplus_password_plaintext": "", "chrome_extension": true, "disable_adjacent_seat": false, - "hide_some_image": true, + "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.25, + "auto_reload_page_interval": 0.4, "reset_browser_interval": 0, "max_dwell_time": 60, "proxy_server_port": "", diff --git a/settings.py b/settings.py index ff9996f..c39beba 100644 --- a/settings.py +++ b/settings.py @@ -41,7 +41,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.03.27)" +CONST_APP_VERSION = "MaxBot (2024.03.28)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" @@ -681,7 +681,7 @@ 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.25 + config_dict["advanced"]["auto_reload_page_interval"] = 0.4 config_dict["advanced"]["reset_browser_interval"] = 0 config_dict["advanced"]["max_dwell_time"] = 60 config_dict["advanced"]["proxy_server_port"] = "" diff --git a/webdriver/Maxblockplus_1.0.0/data/settings.json b/webdriver/Maxblockplus_1.0.0/data/settings.json index bd5d0b5..771f7da 100644 --- a/webdriver/Maxblockplus_1.0.0/data/settings.json +++ b/webdriver/Maxblockplus_1.0.0/data/settings.json @@ -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.25, "reset_browser_interval": 0, "max_dwell_time": 60, "proxy_server_port": "", "window_size": "480,1024,0", "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/*"]} \ No newline at end of file +{"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": 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.4, "reset_browser_interval": 0, "max_dwell_time": 60, "proxy_server_port": "", "window_size": "480,1024,2", "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/*"]} \ No newline at end of file diff --git a/webdriver/Maxbotplus_1.0.0/data/settings.json b/webdriver/Maxbotplus_1.0.0/data/settings.json index d168656..848613b 100644 --- a/webdriver/Maxbotplus_1.0.0/data/settings.json +++ b/webdriver/Maxbotplus_1.0.0/data/settings.json @@ -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.25, "reset_browser_interval": 0, "max_dwell_time": 60, "proxy_server_port": "", "window_size": "480,1024,0", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}} \ No newline at end of file +{"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": 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.4, "reset_browser_interval": 0, "max_dwell_time": 60, "proxy_server_port": "", "window_size": "480,1024,2", "idle_keyword": "", "resume_keyword": "", "idle_keyword_second": "", "resume_keyword_second": ""}} \ No newline at end of file diff --git a/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js b/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js index ee16265..7d35b6c 100644 --- a/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js +++ b/webdriver/Maxbotplus_1.0.0/js/kktix_registrations_reload.js @@ -114,7 +114,7 @@ function kktix_ajax_return_register_info(register_info) } else { kktix_event_base_info(register_info); - kktix_force_auto_reload_by_timer() + kktix_force_auto_reload_by_timer(); } } @@ -198,7 +198,9 @@ storage.get('status', function (items) { if (items.status && items.status=='ON') { - kktix_event_register_info(); + // DISABLE this feature, to reduce access log. + //kktix_event_register_info(); + kktix_force_auto_reload_by_timer(); } else { //console.log('maxbot status is not ON'); }