This commit is contained in:
piair 2022-02-23 18:10:31 +01:00
parent 6cedec4982
commit 590f5982bd
1 changed files with 4 additions and 13 deletions

17
V4.py
View File

@ -165,7 +165,6 @@ def LogError(message,log = FullLog, Mobdriver = None):
webhookFailure.send(file=discord.File('page.html')) webhookFailure.send(file=discord.File('page.html'))
def progressBar(current, total=30, barLength = 20, name ="Progress"): def progressBar(current, total=30, barLength = 20, name ="Progress"):
percent = float(current+1) * 100 / total percent = float(current+1) * 100 / total
arrow = '-' * int(percent/100 * barLength - 1) + '>' arrow = '-' * int(percent/100 * barLength - 1) + '>'
@ -191,21 +190,17 @@ def RGPD():
pass pass
def PlayQuiz2(override = 10): def PlayQuiz2(override):
RGPD() if not override :
override = 10
for j in range (override): for j in range (override):
try : try :
CustomSleep(uniform(3,5)) CustomSleep(uniform(3,5))
txt = driver.page_source txt = driver.page_source
secret = search('IG:\"([^\"]+)\"', txt)[1] #variable dans la page, pour calculer le offset secret = search('IG:\"([^\"]+)\"', txt)[1] #variable dans la page, pour calculer le offset
print(secret)
reponse1 = search("data-option=\"([^\"]+)\"", txt)[1] reponse1 = search("data-option=\"([^\"]+)\"", txt)[1]
print(reponse1)
offset = int(secret[-2:],16) # la conversion ec decimal des deux dernier caracteres de IG offset = int(secret[-2:],16) # la conversion ec decimal des deux dernier caracteres de IG
print(offset)
reponse = search("correctAnswer\":\"([0-9]+)", txt)[1] reponse = search("correctAnswer\":\"([0-9]+)", txt)[1]
print(reponse)
somme = 0 somme = 0
for i in reponse1 : for i in reponse1 :
@ -224,7 +219,6 @@ def PlayQuiz2(override = 10):
except exceptions.ElementNotInteractableException as e : except exceptions.ElementNotInteractableException as e :
driver.execute_script("arguments[0].click();", elem) driver.execute_script("arguments[0].click();", elem)
except Exception as e: except Exception as e:
LogError("PlayQuiz2" + str(e)) LogError("PlayQuiz2" + str(e))
break break
@ -335,7 +329,7 @@ def AllCard(): #fonction qui clique sur les cartes
reset() reset()
print(f"DailyCard {titre} ok ") print(f"DailyCard {titre} ok ")
except Exception as e : except Exception as e :
printf(f"Allcard card {i} error") printf(f"Allcard card {i+1} error")
except Exception as e : except Exception as e :
LogError(f'Dailycards {e}') LogError(f'Dailycards {e}')
@ -557,7 +551,6 @@ def TryPlay(nom ="inconnu"):
if number == 8 or number == 9 : if number == 8 or number == 9 :
try : try :
printf(f'Quiz 8 détécté sur la page {nom}') printf(f'Quiz 8 détécté sur la page {nom}')
RGPD()
PlayQuiz8(override) PlayQuiz8(override)
printf(f'Quiz 8 reussit sur {nom}') printf(f'Quiz 8 reussit sur {nom}')
except Exception as e : except Exception as e :
@ -566,7 +559,6 @@ def TryPlay(nom ="inconnu"):
elif number == 5 or number == 4 : elif number == 5 or number == 4 :
try : try :
printf(f'Quiz 4 détécté sur la page {nom}') printf(f'Quiz 4 détécté sur la page {nom}')
RGPD()
PlayQuiz4(override) PlayQuiz4(override)
print(f'Quiz 4 reussit sur {nom}') print(f'Quiz 4 reussit sur {nom}')
except Exception as e : except Exception as e :
@ -574,7 +566,6 @@ def TryPlay(nom ="inconnu"):
elif number == 3 or number == 2 : elif number == 3 or number == 2 :
try : try :
RGPD()
printf(f'Quiz 2 détécté sur la page {nom}') printf(f'Quiz 2 détécté sur la page {nom}')
PlayQuiz2(override) PlayQuiz2(override)
print(f'Quiz 2 reussit sur la page {nom}') print(f'Quiz 2 reussit sur la page {nom}')