added switches
This commit is contained in:
parent
68395f4314
commit
4aef2bf948
11
V5.py
11
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,7 +579,14 @@ 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():
|
||||
|
|
|
@ -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 :
|
||||
|
|
|
@ -34,3 +34,5 @@ sql_host = "https://example.com"
|
|||
sql_database = "MsRewards"
|
||||
dev = False
|
||||
norvege = False
|
||||
database_error_override = False
|
||||
fast = False
|
||||
|
|
|
@ -31,5 +31,8 @@ usr = root
|
|||
pwd = password
|
||||
|
||||
[OTHER]
|
||||
|
||||
avatar = https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp
|
||||
ipv6 = False
|
||||
database_override = False
|
||||
fast = False
|
||||
|
|
Loading…
Reference in New Issue