claim multiple things ?
This commit is contained in:
parent
90bcd29d36
commit
8943c0e15d
49
V4.py
49
V4.py
@ -36,8 +36,15 @@ def WaitUntilVisible(by, id, to = 20, browser = driver):
|
|||||||
print(f"element not found after {to}s")
|
print(f"element not found after {to}s")
|
||||||
|
|
||||||
|
|
||||||
def claim_amazon(auto = True):
|
def claim(auto = True, reward = "amazon"):
|
||||||
def middle():
|
dic_id = {"amazon" : "000803000031", "RP" : "000403000103", "fnac" : ""}
|
||||||
|
dic_fun = {"amazon" : amazon, "RP": rp, 'fnac': fnac}
|
||||||
|
|
||||||
|
|
||||||
|
def number_verification():
|
||||||
|
driver.find_element(By.XPATH, "//span[contains( text( ), 'ÉCHANGER UNE RÉCOMPENSE')]").click()
|
||||||
|
sleep(5)
|
||||||
|
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRMER LA RÉCOMPENSE')]").click()
|
||||||
countrycode = driver.find_element(By.ID, 'redeem-checkout-challenge-countrycode')
|
countrycode = driver.find_element(By.ID, 'redeem-checkout-challenge-countrycode')
|
||||||
phone = driver.find_element(By.ID, "redeem-checkout-challenge-fullnumber")
|
phone = driver.find_element(By.ID, "redeem-checkout-challenge-fullnumber")
|
||||||
sel = Select(countrycode)
|
sel = Select(countrycode)
|
||||||
@ -52,8 +59,7 @@ def claim_amazon(auto = True):
|
|||||||
driver.find_element(By.ID, "redeem-checkout-challenge-confirm").click()
|
driver.find_element(By.ID, "redeem-checkout-challenge-confirm").click()
|
||||||
|
|
||||||
def start():
|
def start():
|
||||||
driver.get("https://rewards.bing.com/redeem/000803000031")
|
driver.get(f"https://rewards.bing.com/redeem/{dic_id[reward]}")
|
||||||
sleep(5)
|
|
||||||
try :
|
try :
|
||||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'ÉCHANGER UNE RÉCOMPENSE')]").click()
|
driver.find_element(By.XPATH, "//span[contains( text( ), 'ÉCHANGER UNE RÉCOMPENSE')]").click()
|
||||||
except :
|
except :
|
||||||
@ -65,7 +71,7 @@ def claim_amazon(auto = True):
|
|||||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRM REWARD')]").click()
|
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRM REWARD')]").click()
|
||||||
sleep(5)
|
sleep(5)
|
||||||
|
|
||||||
def end():
|
def amazon():
|
||||||
driver.get("https://rewards.bing.com/redeem/orderhistory")
|
driver.get("https://rewards.bing.com/redeem/orderhistory")
|
||||||
try :
|
try :
|
||||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'Détails de la commande')]").click()
|
driver.find_element(By.XPATH, "//span[contains( text( ), 'Détails de la commande')]").click()
|
||||||
@ -82,7 +88,6 @@ def claim_amazon(auto = True):
|
|||||||
box.send_keys(code)
|
box.send_keys(code)
|
||||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'Déverrouillez votre récompense')]").click()
|
driver.find_element(By.XPATH, "//span[contains( text( ), 'Déverrouillez votre récompense')]").click()
|
||||||
sleep(5)
|
sleep(5)
|
||||||
#amazon = search("> ([^ ]+) <", fcode)[1]
|
|
||||||
fcode = driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/main/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div/div/div/div/div/div[2]/span").get_attribute("innerHTML")
|
fcode = driver.find_element(By.XPATH, "/html/body/div[1]/div[1]/main/div/div/div/div/div[1]/div/div[1]/div[2]/div[2]/div/div/div/div/div/div[2]/span").get_attribute("innerHTML")
|
||||||
if fcode :
|
if fcode :
|
||||||
webhookSuccess.send(_mail)
|
webhookSuccess.send(_mail)
|
||||||
@ -92,28 +97,27 @@ def claim_amazon(auto = True):
|
|||||||
LogError("impossible de localiser le code ", driver, _mail)
|
LogError("impossible de localiser le code ", driver, _mail)
|
||||||
return(1)
|
return(1)
|
||||||
|
|
||||||
|
def fnac():
|
||||||
|
pass
|
||||||
|
|
||||||
|
def rp():
|
||||||
|
pass
|
||||||
try :
|
try :
|
||||||
start()
|
start()
|
||||||
|
|
||||||
if ("/rewards/redeem/orderhistory" in driver.page_source) :
|
if ("/rewards/redeem/orderhistory" in driver.page_source) :
|
||||||
end()
|
dic_fun[reward]
|
||||||
|
|
||||||
else :
|
else :
|
||||||
if auto:
|
if auto:
|
||||||
LogError("la recuperation ne peux pas être automatique", driver, _mail)
|
LogError("la recuperation ne peux pas être automatique", driver, _mail)
|
||||||
return(0)
|
return(0)
|
||||||
else :
|
else :
|
||||||
middle()
|
number_verification()
|
||||||
while ("Il existe un problème avec votre compte ou votre commande" in driver.page_source) :
|
while ("Il existe un problème avec votre compte ou votre commande" in driver.page_source) :
|
||||||
print("le numero de telephone est ban")
|
print("le numero de telephone est ban")
|
||||||
driver.get("https://rewards.bing.com/redeem/000803000031")
|
driver.get(f"https://rewards.bing.com/redeem/{dic_id[reward]}")
|
||||||
sleep(5)
|
number_verification()
|
||||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'ÉCHANGER UNE RÉCOMPENSE')]").click()
|
|
||||||
sleep(5)
|
dic_fun[reward]
|
||||||
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRMER LA RÉCOMPENSE')]").click()
|
|
||||||
|
|
||||||
middle()
|
|
||||||
end()
|
|
||||||
|
|
||||||
except Exception as e :
|
except Exception as e :
|
||||||
LogError(f'problème dans la recuperation : {str(e)}', driver, _mail)
|
LogError(f'problème dans la recuperation : {str(e)}', driver, _mail)
|
||||||
@ -645,7 +649,7 @@ def LogPoint(account="unknown"): # log des points sur discord
|
|||||||
webhookSuccess.send(f"{account} actuellement à {str(points)} points")
|
webhookSuccess.send(f"{account} actuellement à {str(points)} points")
|
||||||
|
|
||||||
if CLAIM_AMAZON and int(points) >= 7500:
|
if CLAIM_AMAZON and int(points) >= 7500:
|
||||||
if (claim_amazon() == 1) :
|
if (claim(reward="amazon") == 1) :
|
||||||
points = str( int(points) - 7500)
|
points = str( int(points) - 7500)
|
||||||
|
|
||||||
if sql_enabled :
|
if sql_enabled :
|
||||||
@ -930,7 +934,7 @@ def CustomStart(Credentials):
|
|||||||
def SelectAccount(multiple = True):
|
def SelectAccount(multiple = True):
|
||||||
system("clear") # clear from previous command to allow a clean choice
|
system("clear") # clear from previous command to allow a clean choice
|
||||||
emails = [x[0] for x in Credentials] # list of all email adresses
|
emails = [x[0] for x in Credentials] # list of all email adresses
|
||||||
emailsSelected = enquiries.choose("quels comptes ?", emails, multi=multiple)
|
emailsSelected = enquiries.choose(f"quel{'s' if multiple else ''} compte{'s' if multiple else ''} ?", emails, multi=multiple)
|
||||||
return([x for x in Credentials if x[0] in emailsSelected])
|
return([x for x in Credentials if x[0] in emailsSelected])
|
||||||
|
|
||||||
|
|
||||||
@ -992,9 +996,12 @@ elif UNBAN:
|
|||||||
elif CLAIM:
|
elif CLAIM:
|
||||||
global _mail, _password
|
global _mail, _password
|
||||||
_mail, _password = SelectAccount(False)[0]
|
_mail, _password = SelectAccount(False)[0]
|
||||||
|
reward = enquiries.choose(f"quels recompense ?", ["amazon", "fnac", "RP"], multi=False)
|
||||||
|
|
||||||
driver = FirefoxDriver()
|
driver = FirefoxDriver()
|
||||||
login()
|
login()
|
||||||
claim_amazon(False)
|
|
||||||
|
claim(False, reward)
|
||||||
|
|
||||||
elif POINTS_FILE != "":
|
elif POINTS_FILE != "":
|
||||||
SavePointsFromFile(POINTS_FILE)
|
SavePointsFromFile(POINTS_FILE)
|
||||||
|
Loading…
Reference in New Issue
Block a user