This commit is contained in:
piair 2022-11-12 23:31:58 +01:00
parent 81dc0f7310
commit a19e40b7e5
1 changed files with 61 additions and 50 deletions

111
V4.py
View File

@ -418,6 +418,7 @@ def login():
def BingPcSearch(override=randint(35, 40)): def BingPcSearch(override=randint(35, 40)):
StartTask(task["PC"])
ChangeColor(task["PC"], "blue") ChangeColor(task["PC"], "blue")
driver.get(f"https://www.bing.com/search?q=test") # {choice(Liste_de_mot)}') driver.get(f"https://www.bing.com/search?q=test") # {choice(Liste_de_mot)}')
CustomSleep(uniform(1, 2)) CustomSleep(uniform(1, 2))
@ -732,6 +733,7 @@ def Alerte():
def BingMobileSearch(override=randint(22, 25)): def BingMobileSearch(override=randint(22, 25)):
ChangeColor(task["Mobile"], "blue") ChangeColor(task["Mobile"], "blue")
StartTask(task["Mobile"])
global MobileDriver global MobileDriver
MobileDriver = "unable to start" MobileDriver = "unable to start"
try: try:
@ -820,59 +822,68 @@ def dev():
def CustomStart(Credentials): def CustomStart(Credentials):
if not LINUX_HOST : if not LINUX_HOST :
raise NameError('You need to be on linux to do that, due to the utilisation of a module named enquieries, sorry.') raise NameError('You need to be on linux to do that, due to the utilisation of a module named enquieries, sorry.')
global driver global driver, _mail, _password, p, task
global _mail, _password
system("clear") # clear from previous command to allow a clean choice system("clear") # clear from previous command to allow a clean choice
actions = ["tout", "daily", "pc", "mobile", "LogPoint","Fidelite", "dev"] actions = ["tout", "daily", "pc", "mobile", "LogPoint","Fidelite", "dev"]
Actions = enquiries.choose("quels Actions ?", actions, multi=True) Actions = enquiries.choose("quels Actions ?", actions, multi=True)
liste = SelectAccount()
with Progress(
TextColumn("[progress.description]{task.description}"),
BarColumn(),
TaskProgressColumn(),
TimeRemainingColumn(),
TimeElapsedColumn(),
) as p:
task = modules.progress.dico(p)
for _mail, _password in liste:
for _mail, _password in SelectAccount(): driver = FirefoxDriver()
driver.implicitly_wait(10)
driver = FirefoxDriver() if login() != "STOP":
driver.implicitly_wait(10) if "tout" in Actions:
DailyRoutine(True)
if login() != "STOP": if "daily" in Actions:
if "tout" in Actions: try:
DailyRoutine(True) AllCard()
except Exception as e:
LogError(f"AllCards - {e} -- override", driver, _mail)
if "daily" in Actions: if "pc" in Actions:
try: try:
AllCard() ShowTask(task["PC"])
except Exception as e: BingPcSearch()
LogError(f"AllCards - {e} -- override", driver, _mail) except Exception as e:
LogError(f"il y a eu une erreur dans BingPcSearch, {e} -- override", driver, _mail)
if "pc" in Actions: if "mobile" in Actions:
try: try:
BingPcSearch() ShowTask(task["Mobile"])
except Exception as e: BingMobileSearch()
LogError(f"il y a eu une erreur dans BingPcSearch, {e} -- override", driver, _mail) except Exception as e:
LogError(f"BingMobileSearch - {e} -- override", driver, _mail)
if "mobile" in Actions: if "Fidelite" in Actions:
try: try :
BingMobileSearch() Fidelite()
except Exception as e: except Exception as e :
LogError(f"BingMobileSearch - {e} -- override", driver, _mail) LogError(f"Fidelite - {e} -- override", driver, _mail)
if "Fidelite" in Actions: if "dev" in Actions:
try : try:
Fidelite() dev()
except Exception as e : except Exception as e:
LogError(f"Fidelite - {e} -- override", driver, _mail) printf(e)
break
if "dev" in Actions: if not "tout" in Actions:
try: try:
dev() LogPoint(_mail)
except Exception as e: except Exception as e:
printf(e) print("CustomStart " + str(e))
break driver.close()
if not "tout" in Actions:
try:
LogPoint(_mail)
except Exception as e:
print("CustomStart " + str(e))
driver.close()
def SelectAccount(multiple = True): def SelectAccount(multiple = True):
@ -895,21 +906,21 @@ def unban2():
printf("you are not cureently banned on this account") printf("you are not cureently banned on this account")
def EnableTask(task): def StartTask(task):
p.start_task(task) p.start_task(task)
def ShowTask(task): def ShowTask(task):
p.update(task, visible=True) p.update(task, visible=True)
def AdvanceTask(task, pourcentage): def AdvanceTask(task, pourcentage):
progress.update(task, advance=pourcentage) p.update(task, advance=pourcentage)
def ChangeColor(task, newcolor): def ChangeColor(task, newcolor):
old = progress.tasks[task].description old = p.tasks[task].description
old = old.split(']') old = old.split(']')
old[0] = f"[{newcolor}" old[0] = f"[{newcolor}"
new = "]".join(old) new = "]".join(old)
progress.update(task,description=new) p.update(task,description=new)
if CUSTOM_START: if CUSTOM_START:
@ -919,11 +930,11 @@ elif UNBAN:
else: else:
with Progress( with Progress(
TextColumn("[progress.description]{task.description}"), TextColumn("[progress.description]{task.description}"),
BarColumn(), BarColumn(),
TaskProgressColumn(), TaskProgressColumn(),
TimeRemainingColumn(), TimeRemainingColumn(),
TimeElapsedColumn(), TimeElapsedColumn(),
) as p: ) as p:
task = modules.progress.dico(p) task = modules.progress.dico(p)