From 357cf7050d7b1f44519892764f7617f207a138d8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 6 Mar 2024 09:52:07 +0800 Subject: [PATCH] 2024-02-03, update for macOS arm download chrome-driver fail. --- chrome_tixcraft.py | 14 +++++++++++++- config_launcher.py | 2 +- settings.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/chrome_tixcraft.py b/chrome_tixcraft.py index 8da89e8..483bd4a 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.02)" +CONST_APP_VERSION = "MaxBot (2024.02.03)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json" @@ -773,6 +773,7 @@ def load_chromdriver_uc(config_dict): # use chromedriver_autodownload instead of uc auto download. is_cache_exist = clean_uc_exe_cache() + fail_1 = False try: options = get_uc_options(uc, config_dict, webdriver_path) driver = uc.Chrome(driver_executable_path=chromedriver_path, options=options, headless=config_dict["advanced"]["headless"]) @@ -787,7 +788,18 @@ def load_chromdriver_uc(config_dict): if "This version of ChromeDriver only supports Chrome version" in error_message: print(CONST_CHROME_VERSION_NOT_MATCH_EN) print(CONST_CHROME_VERSION_NOT_MATCH_TW) + fail_1 = True + fail_2 = False + if fail_1: + try: + options = get_uc_options(uc, config_dict, webdriver_path) + driver = uc.Chrome(options=options) + except Exception as exc: + print(exc) + fail_2 = True + + if fail_2: # remove exist chromedriver, download again. try: print("Deleting exist and download ChromeDriver again.") diff --git a/config_launcher.py b/config_launcher.py index d42c04c..a418f60 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.02)" +CONST_APP_VERSION = "MaxBot (2024.02.03)" CONST_MAXBOT_LAUNCHER_FILE = "config_launcher.json" CONST_MAXBOT_CONFIG_FILE = "settings.json" diff --git a/settings.py b/settings.py index 947bf1a..28142d5 100644 --- a/settings.py +++ b/settings.py @@ -40,7 +40,7 @@ try: except Exception as exc: pass -CONST_APP_VERSION = "MaxBot (2024.02.02)" +CONST_APP_VERSION = "MaxBot (2024.02.03)" CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt" CONST_MAXBOT_CONFIG_FILE = "settings.json"