better config path + enabled proxy usage
This commit is contained in:
parent
00a947631a
commit
cf7ab67f7c
32
V4.py
32
V4.py
@ -67,15 +67,22 @@ else:
|
|||||||
config_path = "/home/pi/MsReward/config"
|
config_path = "/home/pi/MsReward/config"
|
||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
|
#path comfigurations
|
||||||
MotPath = config["DEFAULT"]["motpath"]
|
MotPath = config["PATH"]["motpath"]
|
||||||
LogPath = config["DEFAULT"]["logpath"]
|
LogPath = config["PATH"]["logpath"]
|
||||||
|
#discord configurations
|
||||||
SuccessLink = config["DEFAULT"]["successlink"]
|
SuccessLink = config["DEFAULT"]["successlink"]
|
||||||
ErrorLink = config["DEFAULT"]["errorlink"]
|
ErrorLink = config["DEFAULT"]["errorlink"]
|
||||||
FidelityLink = config["DEFAULT"]["FidelityLink"]
|
#bsae settings
|
||||||
embeds = config["DEFAULT"]["embeds"] == "True"
|
FidelityLink = config["SETTINGS"]["FidelityLink"]
|
||||||
Headless = config["DEFAULT"]["headless"] == "True"
|
embeds = config["SETTINGS"]["embeds"] == "True" #print new point value in an embed
|
||||||
|
Headless = config["SETTINGS"]["headless"] == "True"
|
||||||
|
|
||||||
|
#proxy settings
|
||||||
|
|
||||||
|
proxy_enabled = config["PROXY"]["enabled"] == "True"
|
||||||
|
proxy_adress = config["SETTINGS"]["url"]
|
||||||
|
proxy_port = config["SETTINGS"]["port"]
|
||||||
|
|
||||||
g = open(MotPath, "r", encoding="utf-8")
|
g = open(MotPath, "r", encoding="utf-8")
|
||||||
Liste_de_mot = list(g.readline().split(","))
|
Liste_de_mot = list(g.readline().split(","))
|
||||||
@ -84,8 +91,19 @@ g.close()
|
|||||||
webhookSuccess = Webhook.from_url(SuccessLink, adapter=RequestsWebhookAdapter())
|
webhookSuccess = Webhook.from_url(SuccessLink, adapter=RequestsWebhookAdapter())
|
||||||
webhookFailure = Webhook.from_url(ErrorLink, 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",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def FirefoxDriver(mobile=False, Headless=Headless):
|
def FirefoxDriver(mobile=False, Headless=Headless):
|
||||||
|
if proxy_enabled :
|
||||||
|
setup_proxy(proxy_adress,proxy_port)
|
||||||
|
|
||||||
PC_USER_AGENT = (
|
PC_USER_AGENT = (
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
||||||
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
||||||
@ -914,7 +932,7 @@ if override:
|
|||||||
CustomStart(Credentials)
|
CustomStart(Credentials)
|
||||||
else:
|
else:
|
||||||
for i in Credentials:
|
for i in Credentials:
|
||||||
|
system("pkill -9 firefox")
|
||||||
_mail = i[0]
|
_mail = i[0]
|
||||||
_password = i[1]
|
_password = i[1]
|
||||||
|
|
||||||
|
24
config
24
config
@ -1,9 +1,21 @@
|
|||||||
[DEFAULT]
|
[PATH]
|
||||||
motpath = /your/path/to/words/list.txt
|
|
||||||
logpath = /your/path/to/words/loginandpass.csv
|
motpath = /your/path/to/words_list.txt
|
||||||
successlink = https://discord.com/api/webhooks/[put your webhook here]
|
logpath = /your/path/to/loginandpass.csv
|
||||||
errorlink =https://discord.com/api/webhooks/[put your webhook here]
|
|
||||||
|
[SETTINGS]
|
||||||
|
|
||||||
FidelityLink = Null
|
FidelityLink = Null
|
||||||
embeds = False
|
embeds = False
|
||||||
Headless = True
|
Headless = True
|
||||||
Log = False
|
|
||||||
|
[DISCORD]
|
||||||
|
|
||||||
|
successlink = https://discord.com/api/webhooks/[put your webhook here]
|
||||||
|
errorlink =https://discord.com/api/webhooks/[put your webhook here]
|
||||||
|
|
||||||
|
[PROXY]
|
||||||
|
|
||||||
|
enabled = False
|
||||||
|
url = Null
|
||||||
|
port = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user