From 66c979c624963f4c0de89d1654d2d8ad477cfb7a Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 24 May 2022 22:39:18 +0200 Subject: [PATCH] STILL --- V4.py | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/V4.py b/V4.py index e4bfffa..475a2be 100755 --- a/V4.py +++ b/V4.py @@ -93,24 +93,10 @@ g = open(MotPath, "r", encoding="utf-8") Liste_de_mot = list(g.readline().split(",")) g.close() -if discord_enabled: - webhookSuccess = Webhook.from_url(SuccessLink, adapter=RequestsWebhookAdapter()) + webhookFailure = Webhook.from_url(ErrorLink, adapter=RequestsWebhookAdapter()) -def setup_proxy(ip, port) : - PROXY = f"{ip}:{port}" - webdriver.DesiredCapabilities.FIREFOX['proxy'] = { - "httpProxy": PROXY, - "sslProxy": PROXY, - "proxyType": "MANUAL", - } - - -if sql_enabled : - mycursor = setup_MySQL() - - def setup_MySQL(): mydb = mysql.connector.connect( host=sql_host, @@ -120,6 +106,21 @@ def setup_MySQL(): ) return(mydb.cursor()) + +if sql_enabled : + mycursor = setup_MySQL() +if discord_enabled: + webhookSuccess = Webhook.from_url(SuccessLink, adapter=RequestsWebhookAdapter()) + +def setup_proxy(ip, port) : + PROXY = f"{ip}:{port}" + webdriver.DesiredCapabilities.FIREFOX['proxy'] = { + "httpProxy": PROXY, + "sslProxy": PROXY, + "proxyType": "MANUAL", + } + + def add_row(compte, points): sql = "INSERT INTO daily (compte, points, date) VALUES (%s, %s, current_date())" val = (compte, points)