--claim amazon

This commit is contained in:
piair 2023-01-14 16:56:33 +01:00
parent ab8ac50fb2
commit bb5dbb3cbd
3 changed files with 68 additions and 32 deletions

91
V4.py
View File

@ -36,8 +36,21 @@ 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(): def claim_amazon(auto = True):
try : def middle():
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')
phone = driver.find_element(By.ID, "redeem-checkout-challenge-fullnumber")
sel = Select(countrycode)
CC = input("enter start of number (33, ...) ")
sel.select_by_value(CC)
ph = input("entrez le numero de telephone : +33")
send_keys_wait(phone, ph)
driver.find_element(By.ID, "redeem-checkout-challenge-validate").click()
def start():
driver.get("https://rewards.bing.com/redeem/000803000031") driver.get("https://rewards.bing.com/redeem/000803000031")
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()
@ -48,39 +61,53 @@ def claim_amazon():
driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRMER LA RÉCOMPENSE')]").click() driver.find_element(By.XPATH, "//span[contains( text( ), 'CONFIRMER LA RÉCOMPENSE')]").click()
except : except :
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():
driver.get("https://rewards.bing.com/redeem/orderhistory")
try :
driver.find_element(By.XPATH, "//span[contains( text( ), 'Détails de la commande')]").click()
except :
driver.find_element(By.XPATH, "//span[contains( text( ), 'Get code')]").click()
sleep(5)
code = driver.find_element(By.CLASS_NAME, "tango-credential-value").get_attribute('innerHTML')
lien = driver.find_elements(By.CLASS_NAME, "tango-credential-key")[1].get_attribute('innerHTML')
lien = search('\"([^\"]+)\"',lien)[1]
driver.get(lien)
sleep(10)
box = driver.find_element(By.ID, "input-45")
box.click()
box.send_keys(code)
driver.find_element(By.XPATH, "//span[contains( text( ), 'Déverrouillez votre récompense')]").click()
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")
if fcode :
webhookSuccess.send(_mail)
webhookSuccess.send(fcode)
return(1)
else :
LogError("impossible de localiser le code ", driver, _mail)
return(1)
try :
start()
if ("/rewards/redeem/orderhistory" in driver.page_source) : if ("/rewards/redeem/orderhistory" in driver.page_source) :
driver.get("https://rewards.bing.com/redeem/orderhistory") end()
try :
driver.find_element(By.XPATH, "//span[contains( text( ), 'Détails de la commande')]").click()
except :
driver.find_element(By.XPATH, "//span[contains( text( ), 'Get code')]").click()
sleep(5)
code = driver.find_element(By.CLASS_NAME, "tango-credential-value").get_attribute('innerHTML')
lien = driver.find_elements(By.CLASS_NAME, "tango-credential-key")[1].get_attribute('innerHTML')
lien = search('\"([^\"]+)\"',lien)[1]
driver.get(lien)
sleep(10)
box = driver.find_element(By.ID, "input-45")
box.click()
box.send_keys(code)
driver.find_element(By.XPATH, "//span[contains( text( ), 'Déverrouillez votre récompense')]").click()
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")
if fcode :
webhookSuccess.send(_mail)
webhookSuccess.send(fcode)
return(1)
else :
LogError("impossible de localiser le code ", driver, _mail)
return(1)
else : else :
LogError("la recuperation ne peux pas être automatique", driver, _mail) if auto:
return(0) LogError("la recuperation ne peux pas être automatique", driver, _mail)
return(0)
else :
middle()
while ("Il existe un problème avec votre compte ou votre commande" in driver.page_source) :
print("le numero de telephone est ban")
driver.get("https://rewards.bing.com/redeem/000803000031")
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)
@ -417,7 +444,7 @@ def login():
raise Banned() raise Banned()
except Exception as e: except Exception as e:
LogError(f"login - 3 - {e}", driver, _mail) LogError(f"login - 3 - {e}", driver, _mail)
driver.close() driver.quit()
CustomSleep(1200) CustomSleep(1200)
driver = FirefoxDriver() driver = FirefoxDriver()
return("STOP") return("STOP")
@ -955,6 +982,8 @@ if CUSTOM_START:
CustomStart(Credentials) CustomStart(Credentials)
elif UNBAN: elif UNBAN:
unban2() unban2()
elif CLAIM:
claim_amazon(False)
elif POINTS_FILE != "": elif POINTS_FILE != "":
SavePointsFromFile(POINTS_FILE) SavePointsFromFile(POINTS_FILE)
else: else:

View File

@ -33,6 +33,12 @@ parser.add_argument(
action="store_true" action="store_true"
) )
parser.add_argument(
"--claim",
help="show claim",
dest="claim",
action="store_true"
)
parser.add_argument( parser.add_argument(
"-l", "-l",
@ -73,6 +79,7 @@ parser.add_argument(
) )
args = parser.parse_args() args = parser.parse_args()
CLAIM = args.claim
CUSTOM_START = args.override CUSTOM_START = args.override
UNBAN = args.unban UNBAN = args.unban
LOG = args.log LOG = args.log

View File

@ -69,7 +69,7 @@ def printf2(txt, mail, LOG = LOG):
def check_ipv4(driver): def check_ipv4(driver):
driver.get("https://api64.ipify.org") driver.get("https://api64.ipify.org")
elm = driver.find_element(By.TAG_NAME, "body") elm = driver.find_element(BY.TAG_NAME, "body")
if len(elm.text.split('.')) == 4 : if len(elm.text.split('.')) == 4 :
return True return True
return False return False