This commit is contained in:
piair 2022-06-17 07:05:46 +02:00
parent fbed3ae854
commit 0f5c64f9d3

31
V4.py
View File

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