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

11
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("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:

View File

@ -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 :

View File

@ -33,4 +33,6 @@ sql_pwd = "azerty"
sql_host = "https://example.com"
sql_database = "MsRewards"
dev = False
norvege = False
norvege = False
database_error_override = False
fast = False

View File

@ -31,5 +31,8 @@ usr = root
pwd = password
[OTHER]
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