From 004e17fefab5a987e5c0f4805caee21dc5bd4ad8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 16 Feb 2024 10:58:39 +0800 Subject: [PATCH] 2024-01-20, update for hkticketing --- chrome_tixcraft.py | 28 ++++++++++++++++++++++++++-- config_launcher.py | 2 +- settings.py | 2 +- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index a1238aa..c0454fc 100644 --- a/chrome_tixcraft.py +++ b/chrome_tixcraft.py @@ -41,7 +41,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.01.19)" +CONST_APP_VERSION = "MaxBot (2024.01.20)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" @@ -9745,7 +9745,7 @@ def hkticketing_url_redirect(driver, url, config_dict): for redirect_url in redirect_url_list: if redirect_url in url: # for hkticketing. - entry_url = 'http://entry-hotshow.hkticketing.com/' + entry_url = 'https://entry-hotshow.hkticketing.com/' # for macau # for ticketek.com @@ -9766,6 +9766,30 @@ def hkticketing_url_redirect(driver, url, config_dict): if is_redirected: break + + # for Access denied (403) + if url == 'https://entry-hotshow.hkticketing.com/': + content_redirect_string_list = ['Access denied (403)','Current session has been terminated'] + is_need_refresh = False + html_body = None + try: + html_body = driver.page_source + except Exception as exc: + #print(exc) + pass + if not html_body is None: + for each_redirect_string in content_redirect_string_list: + if each_redirect_string in html_body: + is_need_refresh = True + break + if is_need_refresh: + entry_url = "https://hotshow.hkticketing.com/" + try: + driver.get(entry_url) + is_redirected = True + except Exception as exc: + pass + return is_redirected def hkticketing_content_refresh(driver, url, config_dict): diff --git a/config_launcher.py b/config_launcher.py index 39d69db..b5dad50 100644 --- a/config_launcher.py +++ b/config_launcher.py @@ -22,7 +22,7 @@ import sys import threading import webbrowser -CONST_APP_VERSION = "MaxBot (2024.01.19)" +CONST_APP_VERSION = "MaxBot (2024.01.20)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/settings.py b/settings.py index 95a5d93..5bfcae7 100644 --- a/settings.py +++ b/settings.py @@ -40,7 +40,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.01.19)" +CONST_APP_VERSION = "MaxBot (2024.01.20)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json"