--claim amazon
This commit is contained in:
parent
ab8ac50fb2
commit
bb5dbb3cbd
39
V4.py
39
V4.py
|
@ -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,10 +61,9 @@ 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)
|
||||||
|
|
||||||
if ("/rewards/redeem/orderhistory" in driver.page_source) :
|
def end():
|
||||||
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()
|
||||||
|
@ -78,9 +90,24 @@ def claim_amazon():
|
||||||
LogError("impossible de localiser le code ", driver, _mail)
|
LogError("impossible de localiser le code ", driver, _mail)
|
||||||
return(1)
|
return(1)
|
||||||
|
|
||||||
|
try :
|
||||||
|
start()
|
||||||
|
|
||||||
|
if ("/rewards/redeem/orderhistory" in driver.page_source) :
|
||||||
|
end()
|
||||||
|
|
||||||
else :
|
else :
|
||||||
|
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 :
|
||||||
|
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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue