added switches

This commit is contained in:
piair 2023-05-07 23:26:27 +02:00
parent 68395f4314
commit 4aef2bf948
5 changed files with 27 additions and 4 deletions

9
V5.py
View File

@ -28,6 +28,8 @@ def firefox_driver(mobile=False, headless=False):
options.set_preference('intl.accept_languages', 'fr-FR, fr') options.set_preference('intl.accept_languages', 'fr-FR, fr')
options.set_preference("browser.link.open_newwindow", 3) options.set_preference("browser.link.open_newwindow", 3)
options.set_preference("dom.confirm_repost.testing.always_accept", True) options.set_preference("dom.confirm_repost.testing.always_accept", True)
if g.fast:
options.set_preference("permissions.default.image", 2)
if headless: if headless:
options.add_argument("-headless") options.add_argument("-headless")
if mobile : if mobile :
@ -577,7 +579,14 @@ def log_points(account="unknown"):
webhookSuccess.send(f"{account_name} actuellement à {str(points)} points") webhookSuccess.send(f"{account_name} actuellement à {str(points)} points")
if g.sql_enabled : if g.sql_enabled :
try :
add_to_database(account_name, points, g.sql_host, g.sql_usr, g.sql_pwd, g.sql_database) 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 fidelity():
def sub_fidelity(): def sub_fidelity():

View File

@ -151,6 +151,15 @@ g.sql_host = config["SQL"]["host"]
g.sql_database = config["SQL"]["database"] 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") h = open(g.mot_path, "r", encoding="utf-8")
lines = h.readlines() lines = h.readlines()
if len(lines) < 3 : if len(lines) < 3 :

View File

@ -34,3 +34,5 @@ sql_host = "https://example.com"
sql_database = "MsRewards" sql_database = "MsRewards"
dev = False dev = False
norvege = False norvege = False
database_error_override = False
fast = False

View File

@ -31,5 +31,8 @@ usr = root
pwd = password pwd = password
[OTHER] [OTHER]
avatar = https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp avatar = https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp
ipv6 = False ipv6 = False
database_override = False
fast = False

View File

@ -1 +1 @@
v5.10.5 v5.10.6