a lot easier to edit after.
This commit is contained in:
parent
9f5e722a9c
commit
49cf33c780
20
V4.py
20
V4.py
@ -55,7 +55,7 @@ FAST = args.fast
|
|||||||
if CUSTOM_START :
|
if CUSTOM_START :
|
||||||
LOG = True
|
LOG = True
|
||||||
|
|
||||||
#SOON (maybe)
|
#SOON (maybe) (no)
|
||||||
#logpath = ("/".join(__file__.split("/")[:-1])+"/LogFile.out")
|
#logpath = ("/".join(__file__.split("/")[:-1])+"/LogFile.out")
|
||||||
#logfile = open(logpath, "w")
|
#logfile = open(logpath, "w")
|
||||||
|
|
||||||
@ -87,24 +87,26 @@ CREDENTIALS_PATH = config["PATH"]["logpath"]
|
|||||||
# discord configuration
|
# discord configuration
|
||||||
DISCORD_SUCCESS_LINK = config["DISCORD"]["successlink"]
|
DISCORD_SUCCESS_LINK = config["DISCORD"]["successlink"]
|
||||||
DISCORD_ERROR_LINK = config["DISCORD"]["errorlink"]
|
DISCORD_ERROR_LINK = config["DISCORD"]["errorlink"]
|
||||||
DISCORD_ENABLED = config["DISCORD"]["enabled"]
|
DISCORD_ENABLED_ERROR = config["DISCORD"]["DiscordErrorEnabled"]
|
||||||
|
DISCORD_ENABLED_SUCCESS = config["DISCORD"]["DiscordSuccessEnabled"]
|
||||||
|
|
||||||
if DISCORD_ENABLED:
|
if ErrorEnabled:
|
||||||
webhookFailure = Webhook.from_url(DISCORD_ERROR_LINK, adapter=RequestsWebhookAdapter())
|
webhookFailure = Webhook.from_url(DISCORD_ERROR_LINK, adapter=RequestsWebhookAdapter())
|
||||||
|
if SuccessEnabled:
|
||||||
webhookSuccess = Webhook.from_url(DISCORD_SUCCESS_LINK, adapter=RequestsWebhookAdapter())
|
webhookSuccess = Webhook.from_url(DISCORD_SUCCESS_LINK, adapter=RequestsWebhookAdapter())
|
||||||
|
|
||||||
# base settings
|
# base settings
|
||||||
FidelityLink = config["SETTINGS"]["FidelityLink"]
|
FidelityLink = config["SETTINGS"]["FidelityLink"]
|
||||||
embeds = config["SETTINGS"]["embeds"] == "True" #print new point value in an embed
|
DISCORD_EMBED = config["SETTINGS"]["embeds"] == "True" #print new point value in an embed
|
||||||
Headless = config["SETTINGS"]["headless"] == "True"
|
Headless = config["SETTINGS"]["headless"] == "True"
|
||||||
|
|
||||||
# proxy settings
|
# proxy settings
|
||||||
proxy_enabled = config["PROXY"]["enabled"] == "True"
|
proxy_enabled = config["PROXY"]["proxy_enabled"] == "True"
|
||||||
proxy_address = config["PROXY"]["url"]
|
proxy_address = config["PROXY"]["url"]
|
||||||
proxy_port = config["PROXY"]["port"]
|
proxy_port = config["PROXY"]["port"]
|
||||||
|
|
||||||
# MySQL settings
|
# MySQL settings
|
||||||
sql_enabled = config["SQL"]["enabled"] == "True"
|
sql_enabled = config["SQL"]["sql_enabled"] == "True"
|
||||||
sql_usr = config["SQL"]["usr"]
|
sql_usr = config["SQL"]["usr"]
|
||||||
sql_pwd = config["SQL"]["pwd"]
|
sql_pwd = config["SQL"]["pwd"]
|
||||||
sql_host = config["SQL"]["host"]
|
sql_host = config["SQL"]["host"]
|
||||||
@ -266,7 +268,7 @@ def LogError(message, log=FULL_LOG, Mobdriver=None):
|
|||||||
else:
|
else:
|
||||||
gdriver = driver
|
gdriver = driver
|
||||||
|
|
||||||
if LINUX_HOST and DISCORD_ENABLED:
|
if LINUX_HOST and DISCORD_ENABLED_ERROR:
|
||||||
with open("page.html", "w") as f:
|
with open("page.html", "w") as f:
|
||||||
f.write(gdriver.page_source)
|
f.write(gdriver.page_source)
|
||||||
|
|
||||||
@ -911,9 +913,9 @@ def LogPoint(account="unknown"): # log des points sur discord
|
|||||||
|
|
||||||
account = account.split("@")[0]
|
account = account.split("@")[0]
|
||||||
|
|
||||||
if DISCORD_ENABLED:
|
if DISCORD_ENABLED_SUCCESS:
|
||||||
|
|
||||||
if embeds:
|
if DISCORD_EMBED:
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=f"{account} actuellement à {str(points)} points", colour=Colour.green()
|
title=f"{account} actuellement à {str(points)} points", colour=Colour.green()
|
||||||
)
|
)
|
||||||
|
7
config
7
config
@ -11,19 +11,20 @@ Headless = True
|
|||||||
|
|
||||||
[DISCORD]
|
[DISCORD]
|
||||||
|
|
||||||
enabled = True
|
DiscordErrorEnabled = True
|
||||||
|
DiscordSuccessEnabled = True
|
||||||
successlink = https://discord.com/api/webhooks/[put your webhook here]
|
successlink = https://discord.com/api/webhooks/[put your webhook here]
|
||||||
errorlink =https://discord.com/api/webhooks/[put your webhook here]
|
errorlink =https://discord.com/api/webhooks/[put your webhook here]
|
||||||
|
|
||||||
[PROXY]
|
[PROXY]
|
||||||
|
|
||||||
enabled = False
|
proxy_enabled = False
|
||||||
url = Null
|
url = Null
|
||||||
port = 0
|
port = 0
|
||||||
|
|
||||||
[SQL]
|
[SQL]
|
||||||
|
|
||||||
enabled = False
|
sql_enabled = False
|
||||||
host = Null
|
host = Null
|
||||||
database = MsRewards
|
database = MsRewards
|
||||||
usr = root
|
usr = root
|
||||||
|
22
main.py
22
main.py
@ -32,7 +32,7 @@ text = {"fr" : {
|
|||||||
"ajout" : "comptes ajouté",
|
"ajout" : "comptes ajouté",
|
||||||
"fidelity" : "avez vous un lien sur lequel le lien vers la page fidelité du mois est le seul contenu de la page ?",
|
"fidelity" : "avez vous un lien sur lequel le lien vers la page fidelité du mois est le seul contenu de la page ?",
|
||||||
"lien" : "entrez le lien",
|
"lien" : "entrez le lien",
|
||||||
"discorde" : "voulez vous envoyer les points sur discord ?",
|
"discorde" : "voulez vous envoyer les erreurs sur discord ?",
|
||||||
"w1" : "entrez le lien du WebHook pour envoyer les points (https://support.discord.com/hc/fr/articles/228383668-Utiliser-les-Webhooks)",
|
"w1" : "entrez le lien du WebHook pour envoyer les points (https://support.discord.com/hc/fr/articles/228383668-Utiliser-les-Webhooks)",
|
||||||
"w2" : "entrez le lien du WebHook pour envoyer les erreurs",
|
"w2" : "entrez le lien du WebHook pour envoyer les erreurs",
|
||||||
"msqle" : "voulez vous untiliser une base de donnée",
|
"msqle" : "voulez vous untiliser une base de donnée",
|
||||||
@ -76,18 +76,6 @@ def setup_comptes():
|
|||||||
edit_config_txt("logpath",f'{os.getcwd()}/login.csv')
|
edit_config_txt("logpath",f'{os.getcwd()}/login.csv')
|
||||||
|
|
||||||
|
|
||||||
def edit_config_ligne(ligne, contenu):
|
|
||||||
f = open(config_path, "r")
|
|
||||||
txt = f.readlines()
|
|
||||||
txt[ligne] = f'{txt[ligne].split("=")[0]}= {contenu}\n'
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
f = open(config_path, "w")
|
|
||||||
for i in txt :
|
|
||||||
f.write(i)
|
|
||||||
f.close()
|
|
||||||
|
|
||||||
|
|
||||||
def edit_config_txt(ligne, contenu):
|
def edit_config_txt(ligne, contenu):
|
||||||
f = open(config_path, "r")
|
f = open(config_path, "r")
|
||||||
txt = f.readlines()
|
txt = f.readlines()
|
||||||
@ -121,7 +109,9 @@ def general():
|
|||||||
def discord():
|
def discord():
|
||||||
enabled = confirm(t["discorde"], default = True)
|
enabled = confirm(t["discorde"], default = True)
|
||||||
if enabled :
|
if enabled :
|
||||||
edit_config_ligne(13, True)
|
edit_config_txt("DiscordErrorEnabled", True)
|
||||||
|
|
||||||
|
edit_config_txt('DiscordSuccessEnabled', confirm("send success ?", default = True))
|
||||||
w1 = input(t["w1"])
|
w1 = input(t["w1"])
|
||||||
edit_config_txt("successlink",w1)
|
edit_config_txt("successlink",w1)
|
||||||
w2 = input(t["w2"])
|
w2 = input(t["w2"])
|
||||||
@ -130,7 +120,7 @@ def discord():
|
|||||||
def sql() :
|
def sql() :
|
||||||
enabled = confirm(t["msqle"], default = False)
|
enabled = confirm(t["msqle"], default = False)
|
||||||
if enabled :
|
if enabled :
|
||||||
edit_config_ligne(25, True)
|
edit_config_txt("sql_enabled", True)
|
||||||
lien = input(t["msqll"])
|
lien = input(t["msqll"])
|
||||||
edit_config_txt("host",lien)
|
edit_config_txt("host",lien)
|
||||||
table = input(t["msqlt"])
|
table = input(t["msqlt"])
|
||||||
@ -143,7 +133,7 @@ def sql() :
|
|||||||
def proxy() :
|
def proxy() :
|
||||||
enabled = confirm(t["proxye"], default = False)
|
enabled = confirm(t["proxye"], default = False)
|
||||||
if enabled :
|
if enabled :
|
||||||
edit_config_ligne(19, True)
|
edit_config_txt("proxy_enabled", True)
|
||||||
lien = input(t["proxyl"])
|
lien = input(t["proxyl"])
|
||||||
edit_config_txt("url",lien)
|
edit_config_txt("url",lien)
|
||||||
port = input(t["proxyp"])
|
port = input(t["proxyp"])
|
||||||
|
Loading…
Reference in New Issue
Block a user