From 4aef2bf94883a637531954c3c16ce36943b13b7c Mon Sep 17 00:00:00 2001 From: piair Date: Sun, 7 May 2023 23:26:27 +0200 Subject: [PATCH] added switches --- V5.py | 11 ++++++++++- modules/config.py | 9 +++++++++ modules/globals.py | 4 +++- user_data/config.default | 5 ++++- version | 2 +- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/V5.py b/V5.py index 7775890..7e5c808 100755 --- a/V5.py +++ b/V5.py @@ -28,6 +28,8 @@ def firefox_driver(mobile=False, headless=False): options.set_preference('intl.accept_languages', 'fr-FR, fr') options.set_preference("browser.link.open_newwindow", 3) options.set_preference("dom.confirm_repost.testing.always_accept", True) + if g.fast: + options.set_preference("permissions.default.image", 2) if headless: options.add_argument("-headless") if mobile : @@ -577,8 +579,15 @@ def log_points(account="unknown"): webhookSuccess.send(f"{account_name} actuellement à {str(points)} points") if g.sql_enabled : - add_to_database(account_name, points, g.sql_host, g.sql_usr, g.sql_pwd, g.sql_database) + try : + add_to_database(account_name, points, g.sql_host, g.sql_usr, g.sql_pwd, g.sql_database) + except Exception as e: + if g.database_error_override: + printf("database error.") + else : + log_error(e) + def fidelity(): def sub_fidelity(): try: diff --git a/modules/config.py b/modules/config.py index 23ff192..20e19db 100644 --- a/modules/config.py +++ b/modules/config.py @@ -151,6 +151,15 @@ g.sql_host = config["SQL"]["host"] g.sql_database = config["SQL"]["database"] +try : + g.database_error_override = config["OTHER"]["database_override"] +except : + pass + +try : + g.fast = config["OTHER"]["fast"] +except : + pass h = open(g.mot_path, "r", encoding="utf-8") lines = h.readlines() if len(lines) < 3 : diff --git a/modules/globals.py b/modules/globals.py index bca7c85..09a44c5 100644 --- a/modules/globals.py +++ b/modules/globals.py @@ -33,4 +33,6 @@ sql_pwd = "azerty" sql_host = "https://example.com" sql_database = "MsRewards" dev = False -norvege = False \ No newline at end of file +norvege = False +database_error_override = False +fast = False diff --git a/user_data/config.default b/user_data/config.default index 22340f8..3681b75 100644 --- a/user_data/config.default +++ b/user_data/config.default @@ -31,5 +31,8 @@ usr = root pwd = password [OTHER] + avatar = https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp -ipv6 = False \ No newline at end of file +ipv6 = False +database_override = False +fast = False diff --git a/version b/version index 609a927..19e0d42 100644 --- a/version +++ b/version @@ -1 +1 @@ -v5.10.5 +v5.10.6