mirror of
https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
synced 2025-06-12 06:04:46 +02:00
bruh ?
This commit is contained in:
@ -2,9 +2,7 @@
|
||||
from modules.driver_tools import *
|
||||
from modules.imports import *
|
||||
import modules.globals as g
|
||||
"""
|
||||
Setup for option, like --override or --fulllog
|
||||
"""
|
||||
import json
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
|
||||
@ -24,13 +22,6 @@ parser.add_argument(
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-l",
|
||||
"--log",
|
||||
dest="log",
|
||||
help="enable logging in terminal",
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-fl",
|
||||
@ -40,6 +31,7 @@ parser.add_argument(
|
||||
action="store_true",
|
||||
)
|
||||
|
||||
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
"--config",
|
||||
@ -47,13 +39,6 @@ parser.add_argument(
|
||||
default=""
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-a",
|
||||
"--add-points",
|
||||
help="Add points to the database from a file and exit",
|
||||
dest="points_file",
|
||||
default=""
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
@ -70,85 +55,72 @@ parser.add_argument(
|
||||
default="None"
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--dev",
|
||||
help="dev option",
|
||||
dest="dev",
|
||||
action="store_true"
|
||||
)
|
||||
|
||||
with open("./user_data/discord.json", "r") as inFile:
|
||||
discord = json.load(inFile)
|
||||
with open("./user_data/settings.json", "r") as inFile:
|
||||
settings = json.load(inFile)
|
||||
with open("./user_data/proxy.json", "r") as inFile:
|
||||
proxy = json.load(inFile)
|
||||
with open("./user_data/configs.json", "r") as inFile:
|
||||
config = json.load(inFile)
|
||||
with open("./user_data/database.json", "r") as inFile:
|
||||
database = json.load(inFile)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
g.custom_start = args.override
|
||||
g.unban = args.unban
|
||||
g.log = args.log
|
||||
g.full_log = args.fulllog
|
||||
g.dev = args.dev
|
||||
|
||||
if g.custom_start :
|
||||
g.log = True
|
||||
|
||||
g.vnc_enabled = args.vnc != "None"
|
||||
g.vnc_port = args.vnc
|
||||
g.points_file = args.points_file
|
||||
g.update_version = args.update_version
|
||||
# global variables used later in the code
|
||||
g.islinux = platform == "linux" # if the computer running this program is Linux, it allow more things
|
||||
g.start_time = time()
|
||||
|
||||
#reading configuration
|
||||
config = configparser.ConfigParser()
|
||||
|
||||
if args.config :
|
||||
try :
|
||||
config_path =f"{path.abspath(path.dirname(path.dirname( __file__ )))}/user_data/config{args.config}.cfg"
|
||||
config.read(config_path)
|
||||
g.mot_path = config["PATH"]["motpath"]
|
||||
except :
|
||||
config_path = path.abspath(args.config)
|
||||
config.read(config_path)
|
||||
else :
|
||||
config_path = f"{path.abspath(path.dirname(path.dirname( __file__ )))}/user_data/config.cfg"
|
||||
config.read(config_path)
|
||||
|
||||
|
||||
# path configurations
|
||||
g.mot_path = config["PATH"]["motpath"]
|
||||
g.credential_path = config["PATH"]["logpath"]
|
||||
g.mot_path = "/usr/share/dict/french"
|
||||
g.credential_path = "./user_data/login.csv"
|
||||
|
||||
|
||||
discord_conf = config[args.config]["discord"]
|
||||
|
||||
# discord configuration
|
||||
g.discord_success_link = config["DISCORD"]["successlink"]
|
||||
g.discord_error_link = config["DISCORD"]["errorlink"]
|
||||
g.discord_enabled_error = config["DISCORD"]["DiscordErrorEnabled"] == "True"
|
||||
g.discord_enabled_success = config["DISCORD"]["DiscordSuccessEnabled"]== "True"
|
||||
try :
|
||||
g.avatar_url = config["OTHER"]["avatar"]
|
||||
except :
|
||||
g.avatar_url = "https://cdn.discordapp.com/icons/793934298977009674/d8055bccef6eca4855c349e808d0d788.webp"
|
||||
|
||||
g.discord_success_link = discord[discord_conf]["successL"]
|
||||
g.discord_error_link = discord[discord_conf]["errorsL"]
|
||||
g.discord_enabled_error = discord[discord_conf]["errorsT"] == "True"
|
||||
g.discord_enabled_success = discord[discord_conf]["successT"] == "True"
|
||||
|
||||
g.avatar_url = settings["avatarlink"]
|
||||
|
||||
|
||||
if g.discord_enabled_error:
|
||||
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
|
||||
if g.discord_enabled_success:
|
||||
webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter())
|
||||
|
||||
# base settings
|
||||
g.fidelity_link = config["SETTINGS"]["FidelityLink"]
|
||||
g.discord_embed = config["SETTINGS"]["embeds"] == "True" #print new point value in an embed
|
||||
g.headless = config["SETTINGS"]["headless"] == "True"
|
||||
g.discord_embed = False # send new point value in an embed, fixed for now
|
||||
g.headless = False
|
||||
|
||||
# proxy settings
|
||||
g.proxy_enabled = config["PROXY"]["proxy_enabled"] == "True"
|
||||
g.proxy_address = config["PROXY"]["url"]
|
||||
g.proxy_port = config["PROXY"]["port"]
|
||||
g.proxy_enabled = config[args.config]["proxy"] != "-1"
|
||||
if g.proxy_enabled :
|
||||
g.proxy_address = proxy[config[args.config]["proxy"]]["address"]
|
||||
g.proxy_port = proxy[config[args.config]["proxy"]]["port"]
|
||||
|
||||
# MySQL settings
|
||||
g.sql_enabled = config["SQL"]["sql_enabled"] == "True"
|
||||
g.sql_usr = config["SQL"]["usr"]
|
||||
g.sql_pwd = config["SQL"]["pwd"]
|
||||
g.sql_host = config["SQL"]["host"]
|
||||
g.sql_database = config["SQL"]["database"]
|
||||
|
||||
g.sql_enabled = database["checked"] == "checked"
|
||||
g.sql_usr = database["usr"]
|
||||
g.sql_pwd = database["pwd"]
|
||||
g.sql_host = database["host"]
|
||||
g.sql_database = database["table"]
|
||||
|
||||
|
||||
try :
|
||||
@ -156,10 +128,9 @@ try :
|
||||
except :
|
||||
pass
|
||||
|
||||
try :
|
||||
g.fast = config["OTHER"]["fast"] == "True"
|
||||
except :
|
||||
pass
|
||||
g.fast = False
|
||||
|
||||
# list of words
|
||||
h = open(g.mot_path, "r", encoding="utf-8")
|
||||
lines = h.readlines()
|
||||
if len(lines) < 3 :
|
||||
@ -169,10 +140,7 @@ else :
|
||||
h.close()
|
||||
|
||||
|
||||
with open(g.credential_path) as f:
|
||||
reader = reader(f)
|
||||
Credentials = list(reader)
|
||||
shuffle(Credentials)
|
||||
Credentials = [ (config[args.config]['accounts'][x]["mail"],config[args.config]['accounts'][x]["pwd"],config[args.config]['accounts'][x]["2fa"]) for x in config[args.config]['accounts']]
|
||||
g._cred = Credentials
|
||||
|
||||
if g.proxy_enabled :
|
||||
|
@ -31,3 +31,4 @@ try:
|
||||
import enquiries
|
||||
except:
|
||||
system("") # enable colors in windows cmd
|
||||
import undetected_chromedriver as uc
|
||||
|
Reference in New Issue
Block a user