This commit is contained in:
piair 2022-06-17 07:05:46 +02:00
parent fbed3ae854
commit 0f5c64f9d3
1 changed files with 23 additions and 8 deletions

31
V4.py
View File

@ -26,6 +26,11 @@ from selenium.webdriver.support.ui import WebDriverWait
import argparse import argparse
import mysql.connector import mysql.connector
"""
Setup for option, like --override or --fulllog
"""
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument( parser.add_argument(
@ -50,6 +55,11 @@ FullLog = args.fulllog
if override : if override :
Log = True Log = True
"""
gloabal variables used later in the code
"""
IsLinux = platform == "linux" IsLinux = platform == "linux"
start_time = time() start_time = time()
@ -57,10 +67,6 @@ global driver
driver = None driver = None
def Timer(text="undefined"):
return(f"[{timedelta(seconds = round(float(time() - start_time)))}] : " + str(text))
if IsLinux: if IsLinux:
import enquiries import enquiries
else: else:
@ -72,10 +78,19 @@ config.read(config_path)
#path comfigurations #path comfigurations
MotPath = config["PATH"]["motpath"] MotPath = config["PATH"]["motpath"]
LogPath = config["PATH"]["logpath"] LogPath = config["PATH"]["logpath"]
#discord configurations
"""
discord configuration
"""
SuccessLink = config["DISCORD"]["successlink"] SuccessLink = config["DISCORD"]["successlink"]
ErrorLink = config["DISCORD"]["errorlink"] ErrorLink = config["DISCORD"]["errorlink"]
discord_enabled = config["DISCORD"]["enabled"] discord_enabled = config["DISCORD"]["enabled"]
webhookFailure = Webhook.from_url(ErrorLink, adapter=RequestsWebhookAdapter())
if discord_enabled:
webhookSuccess = Webhook.from_url(SuccessLink, 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 embeds = config["SETTINGS"]["embeds"] == "True" #print new point value in an embed
@ -100,11 +115,11 @@ else :
g.close() g.close()
webhookFailure = Webhook.from_url(ErrorLink, adapter=RequestsWebhookAdapter())
if discord_enabled: def Timer(text="undefined"):
webhookSuccess = Webhook.from_url(SuccessLink, adapter=RequestsWebhookAdapter()) return(f"[{timedelta(seconds = round(float(time() - start_time)))}] : " + str(text))
def setup_proxy(ip, port) : def setup_proxy(ip, port) :
PROXY = f"{ip}:{port}" PROXY = f"{ip}:{port}"