0% found this document useful (0 votes)
284 views12 pages

Message

This Python code is automating tasks on Amazon Prime Video. It imports necessary libraries, defines functions like signing in, handling CAPTCHAs, changing payment methods, and getting credit card details. The main functions sign the user into their Prime account, handle any CAPTCHAs encountered, and allow changing the payment method by providing a fake credit card number. It tracks the window positions for debugging purposes.

Uploaded by

iicheater800
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views12 pages

Message

This Python code is automating tasks on Amazon Prime Video. It imports necessary libraries, defines functions like signing in, handling CAPTCHAs, changing payment methods, and getting credit card details. The main functions sign the user into their Prime account, handle any CAPTCHAs encountered, and allow changing the payment method by providing a fake credit card number. It tracks the window positions for debugging purposes.

Uploaded by

iicheater800
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 12

import os, threading

try:from selenium import webdriver


except:os.system('pip3 install selenium')
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
try:from twocaptcha import TwoCaptcha
except:
os.system('pip3 install twocaptcha')
os.system('pip3 install 2captcha-python')
import time
import sys
try:from colorama import init, Fore, Back, Style
except:os.system('pip3 install colorama')
try:import requests
except:os.system('pip3 install requests')
try:from faker import Faker
except:os.system('pip3 install faker')
import random
import wmi
import json
from amazoncaptcha import AmazonCaptcha
import winsound
from win32api import GetSystemMetrics
init(autoreset=True)
fake = Faker()
os.system('mode con: cols=35 lines=9')

def delet_line(file_name, line_number):


with open(file_name) as file :
lines = file.readlines()
del lines[line_number]
with open(file_name, 'w') as file:
for line in lines:
file.write(line)
def addToNote(file_name, type1):
file111 = open(file_name, "a")
file111.writelines(type1)
file111.writelines('\n')
file111.close()
def cntlns(file_path):
try:
with open(file_path, 'r') as file:
text = file.read()
lines = text.split('\n')
non_empty_line_count = sum(1 for line in lines if line.strip())
return non_empty_line_count
except FileNotFoundError:
print(f"Error: File '{file_path}' not found.")
except Exception as e:
print(f"An error occurred: {e}")

def SignIn(cnt):
ccapcha(cnt)
print('>signing_Prime...')#signin to prime
WebDriverWait(driver, 10).until(EC.presence_of_element_located((
By.ID,'ap_email'))).send_keys(Amazon_mail)
try:driver.find_element(By.ID,"continue").click(); ccapcha(cnt)
except:pass
WebDriverWait(driver, 10).until(EC.presence_of_element_located((
By.ID,'ap_password'))).send_keys(Amazon_password)
driver.find_element(By.ID,'signInSubmit').click()

ccapcha(cnt)

print(2)
for cptcha in range(1,4):
time.sleep(0.5)
if "Account locked" in driver.page_source:getErr()
if "We cannot find an account with that email address" in
driver.page_source:getErr()
try:img = driver.find_element(By.ID,'auth-captcha-image')
except:break
src = img.get_attribute('src')
solver = TwoCaptcha(api_key, defaultTimeout=40, pollingInterval=10)
try:result = solver.normal(src)
except Exception as e:print(e)
else:
code = result['code'].replace('q', 'g')
print("cpt: "+code)
driver.find_element(By.ID,'ap_password').send_keys(Amazon_password)
for L in code:
driver.find_element(By.ID, 'auth-captcha-guess').send_keys(L);
time.sleep(0.5)
driver.find_element(By.ID,'signInSubmit').click()
print(3)
for cptcha in range(1,4):
# if "Solve this puzzle to protect your account" in driver.page_source or
"Rozwiąż tę zagadkę, aby chronić swoje konto" in driver.page_source or "Los deze
puzzel op om je account te beschermen" in driver.page_source or "Löse das Rätsel,
um dein Konto zu schützen" in driver.page_source:
try:
print(4)
time.sleep(0.5)
if "Account locked" in driver.page_source:getErr()
if "We cannot find an account with that email address" in
driver.page_source:getErr()
try:img = driver.find_element(By.XPATH,
'//*[@id="cvf-page-content"]/div/div/div/div[2]/div/img')
except:break
src = img.get_attribute('src')
solver = TwoCaptcha(api_key, defaultTimeout=40, pollingInterval=10)

try:result = solver.normal(src)
except Exception as e:print(e)
else:
code = result['code'].replace('q', 'g')
print(code)
for L in code:
driver.find_element(By.XPATH,
'//*[@id="cvf-page-content"]/div/div/div/form/div[2]/input').send_keys(L);
time.sleep(0.5)
driver.find_element(By.XPATH,
'//*[@id="a-autoid-0"]/span/input').click()
except:pass

if "To better protect your account" in driver.page_source :


time.sleep(2)
if "Account locked" in driver.page_source:getErr()
if "We cannot find an account with that email address" in
driver.page_source:getErr()
try:img = driver.find_element(By.ID,'auth-captcha-image')
except:break

src = img.get_attribute('src')
solver = TwoCaptcha(api_key, defaultTimeout=40, pollingInterval=10)
try:result = solver.normal(src)
except Exception as e:print(e)
else:
code = result['code'].replace('q', 'g')
print(code)
driver.find_element(By.ID,'ap_password').send_keys(Amazon_password)
for L in code:
driver.find_element(By.ID, 'auth-captcha-guess').send_keys(L);
time.sleep(0.5)
driver.find_element(By.ID,'signInSubmit').click()
ccapcha(cnt)

# if cnt == "de":
# for pph in range(20):
# try:driver.find_element(By.ID,"ap-account-fixup-phone-skip-
link").click();break
# except:time.sleep(0.1)
def ccapcha(web):
while True :
time.sleep(0.5)
if driver.title == f"Amazon.{web}":
driver.execute_script("window.location.reload();")
continue
break

def VDell(op):
act = ActionChains(driver)
print("Vdell")
if op == 1:
print("op1")
driver.switch_to.window(driver.window_handles[1])
act.move_to_element(WebDriverWait(driver,
10).until(EC.presence_of_element_located((By.CLASS_NAME,'a-expander-
prompt')))).click().perform(); time.sleep(0.2)
act.move_to_element(WebDriverWait(driver,
10).until(EC.presence_of_element_located((By.ID,'a-autoid-1')))).click().perform()
while True:
try:driver.find_elements(By.CLASS_NAME,"a-popover-inner")[-1].click();
break
except:pass
driver.switch_to.window(driver.window_handles[0])

###################################################################################
#####
if op == 2:
visaN,visa_m,visa_y,cvv =
getCC(open('./Inputs/visa2.txt').readline().rstrip('\n')).split("|")
driver.switch_to.window(driver.window_handles[1])
# act.move_to_element(driver.find_element(By.NAME,'ppw-
widgetEvent:DeleteInstrumentEvent')).click().perform()
driver.find_elements(By.CLASS_NAME,"a-popover-inner")[-1].click()
act.send_keys(Keys.TAB).perform(); act.send_keys(Keys.TAB).perform();
act.send_keys(Keys.ENTER).perform()
tts = 0
while True:
if tts >= 400 and tts <= 500:
driver.get("https://www.primevideo.com/region/eu/settings/your-account/manage-
payment/ref=atv_set_ya_manpay?subscriptionMarketplaceId&isChannelsSubscription=0")
try:WebDriverWait(driver,
60).until(EC.presence_of_element_located((By.NAME, "ppw-
accountHolderName"))).send_keys(usernm);break
except:tts+=1;time.sleep(0.01)
# driver.find_element(By.NAME,'addCreditCardNumber').send_keys(visaN)
# driver.find_element(By.NAME,'ppw-expirationDate_month').send_keys(visa_m)
# driver.find_element(By.NAME,'ppw-expirationDate_year').send_keys(visa_y)
#
try:driver.find_element(By.NAME,'addCreditCardVerificationNumber').send_keys(cvv)
# except:pass
# time.sleep(3)
# driver.find_element(By.NAME, 'ppw-
widgetEvent:AddCreditCardEvent').click()
# while True:
# try:driver.find_element(By.NAME, 'ppw-
widgetEvent:SelectAddressEvent').click();break
# except:pass
# if "This card is not supported." in driver.page_source:getErr()
# print('>visaChanged!')

###################################################################################
#####

if op == 69:
driver.execute_script("window.open('https://www.primevideo.com/region/na/
settings/your-account/manage-payment/ref=atv_set_ya_manpay?
subscriptionMarketplaceId=ART4WZ8MWBX2Y&isChannelsSubscription=0')")
driver.switch_to.window(driver.window_handles[1])
driver.switch_to.window(driver.window_handles[0])

###################################################################################
#####

def getCC(BIN = 516012,M=str(fake.date().split("-")


[1]),Y=str(random.randint(2024,2028)),CVV=str(random.randint(100,999))):
while True:
credit_card_number = f"{BIN}"+''.join(random.choices('0123456789', k=16-
len(str(BIN))))
digits = [int(x) for x in credit_card_number]
odd_digits = digits[-1::-2]
even_digits = digits[-2::-2]
checksum = sum(odd_digits)
for digit in even_digits:
checksum += sum(divmod(2 * digit, 10))
if checksum % 10 == 0: return credit_card_number+ f'|{M}|{Y}|{CVV}'

def gotop(xpost,ypost):
scn = int(__file__.split("\\")[-2])
rX,rY = int (GetSystemMetrics(0)/3),int (GetSystemMetrics(1)/2)
if scn < 4:pX = scn; pY = 1
else:pX = scn-3; pY = 2
driver.set_window_size(rX,rY)
driver.set_window_position((pX-1)*rX, (pY-1)*rY)
driver.execute_script("window.focus();")

x = driver.get_window_position(windowHandle='current')['x']+xpost
y = driver.get_window_position(windowHandle='current')['y']+ypost
addToNote("gg.txt",str(x)+".."+str(y))

def getErr():
print(gg)
def end(stu, note=''):
global Amazon_mail
if note != "": note = " > "+note

if stu == "done":
addToNote("./Results/done.txt", Amazon_mail+ note)

driver.find_element(By.TAG_NAME,'body').screenshot('./Dn/'+Amazon_mail+'.png')
print(Fore.GREEN+"DONE")
if stu == "err":
addToNote("./Results/err.txt", Amazon_mail+ note)

driver.find_element(By.TAG_NAME,'body').screenshot('./Errs/'+Amazon_mail+'.png')
print(Fore.RED+"ERR")

delet_line("./Inputs/amazon.txt",0)

def GetPhoenNumberN():
APIKEY = "195086U7d7abc345b26137d3cd600ada61130ca"
SERVICE = "am"
OPERATOR = "any"
COUNTRY = 16
MAXPRICE = 9

r = requests.get(f"https://smshub.org/stubs/handler_api.php?
api_key={APIKEY}&action=getNumber&service={SERVICE}&operator={OPERATOR}&country={CO
UNTRY}&maxPrice={MAXPRICE}")
tel,tid = r.text.split(":")[2].removeprefix("44"),r.text.split(":")[1]
return tel,tid
def GetPhoneOtpN(id):
requests.get(f"https://smshub.org/stubs/handler_api.php?
api_key=195086U7d7abc345b26137d3cd600ada61130ca&action=setStatus&id={id}&status={3}
&lang=en"); time.sleep(1)
timer = 0
while True :
time.sleep(0.1)
try:
r = requests.get(f"https://smshub.org/stubs/handler_api.php?
api_key=195086U7d7abc345b26137d3cd600ada61130ca&action=getStatus&id={id}&lang=en")
print('wait Code')
os.system("cls")
print(timer)
masoga = r.text

if timer == 101 : break

if "STATUS_OK" in masoga:pass
else:timer+=1;continue

otp = masoga.split(":")[1]
requests.get(f"https://smshub.org/stubs/handler_api.php?
api_key=195086U7d7abc345b26137d3cd600ada61130ca&action=setStatus&id={id}&status={3}
&lang=en")
print(otp)
return otp
except:timer+=1; continue
return "zopi"

token = '‫'طيزك‬
country = 'canada'
operator = "virtual12"
product = 'amazon'
lang = 'en'
headers = {
'Authorization': 'Bearer ' + token,
'Accept': 'application/json',
}

def GetPhoenNumber():
r = requests.get('https://5sim.net/v1/user/buy/activation/' +country+ '/'
+operator+ '/' +product, headers=headers)
idNum = str(r.json()['id'])
num = str(r.json()['phone']).removeprefix("+1")
return num,idNum
def GetPhoneOtp(id):
timer = 0
while True :
try:
r = requests.get('https://5sim.net/v1/user/check/' + id,
headers=headers)
print('wait Code')
print(timer)
time.sleep(1)
os.system("cls")
# if timer == 20 : driver.find_element(By.ID,"auth-resend-code-
link").click()
if timer == 20 : return "zopi"

masoga = json.loads(r.text)['sms'][-1]
otp = masoga['code']
msg = masoga['text']

addToNote("otp.txt", ' ')


if otp == open("otp.txt").readline().rstrip() or "https://amazon.com/"
in msg :timer+=1; continue
os.remove("otp.txt"); time.sleep(0.1); addToNote("otp.txt", otp)
print(otp)
return otp
except:pass
timer+=1; continue
return "zopi"

def addPhoneNUM():
global tel,tid, nNum
while True:
driver.get("https://www.amazon.com/ap/profile/mobilephone?
ref_=ax_am_landing_add_mobile&openid.assoc_handle=usflex&referringAppAction=CNEP")
#NUMPER
WebDriverWait(driver, 60).until(EC.presence_of_element_located((
By.ID,'ap_phone_number'))).send_keys(tel)
driver.find_element(By.NAME,"countryCode").send_keys("ca")
time.sleep(0.1)
driver.find_element(By.ID,'auth-continue').click(); time.sleep(1.5)
nNum +=1
#BEEB
while True:
try:driver.find_element(By.ID,'auth-pv-enter-code'); break
except:pass
try:act.move_to_element(driver.find_element(By.ID,'auth-account-
conflict-continue-verify-url')).click().perform(); time.sleep(3)
except:pass
try:act.move_to_element(driver.find_element(By.ID,'auth-verification-
ok-announce')).click().perform(); time.sleep(1.5)
except:pass
try:act.move_to_element(driver.find_element(By.ID,'auth-
continue')).click().perform(); time.sleep(1.5)
except:pass

otp = GetPhoneOtp(tid)
if otp == "zopi":
driver.find_element(By.LINK_TEXT,"Change").click()
requests.get(f"https://smshub.org/stubs/handler_api.php?
api_key=APIKEY&action=setStatus&id={tid}&status={8}&lang=en")
while True:
try:tel,tid = GetPhoenNumber(); nNum = 0; break
except:print("BuyingNum")
continue
driver.find_element(By.ID,'auth-pv-enter-code').send_keys(otp+Keys.ENTER)
WebDriverWait(driver,
10).until(EC.presence_of_element_located((By.ID,'ap_password'))).send_keys(Amazon_p
assword)

gotop(94,64)
driver.find_element(By.ID,'auth-cnep-change-email-submit').click()
break

def autoR():
global RR
while RR==True:
driver.refresh()
time.sleep(0.5)

with open("o.txt") as f:
aapi = f.readline().rstrip()
brsr = f.readline().rstrip()

amazon_File_Name = './Inputs/amazon.txt'
api_key = os.getenv('APIKEY_2CAPTCHA', aapi)
solver = TwoCaptcha(api_key)

print(Fore.RED+Style.BRIGHT+"BOT:"+Fore.GREEN+'[A]Chrome - [B]Edge - [C]FireFox')


brser = brsr#input(Fore.GREEN+'>')

if brser == 'A' or brser == 'a':chrome_options = webdriver.ChromeOptions()


if brser == 'B' or brser == 'b':chrome_options = webdriver.EdgeOptions()
if brser == 'C' or brser == 'c':chrome_options = webdriver.FirefoxOptions()

# chrome_options.add_argument("--incognito")
chrome_options.add_argument("--window-size=1920,1080")
chrome_options.add_argument("--window-position=-6000,0")
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument("--disable-infobars")
chrome_options.add_experimental_option("excludeSwitches", ["enable-logging"])
chrome_options.add_experimental_option("excludeSwitches", ["enable-automation"])
chrome_options.add_argument('load-extension=' +
r""+__file__.replace(__file__.split("\\")[-
2],"APR").removesuffix(__file__.split("\\")[-1]))
# chrome_options.add_argument("--headless")
# chrome_options.add_experimental_option("useAutomationExtension", False)
# chrome_options.add_argument('--blink-settings=imagesEnabled=false')

D=0; E=0; EE=0; N=0; Ad="lu"; nMax = 4; nNum = nMax


while True:
try:
#############################################################
#GetAmazon
try:
amazon_File = open(amazon_File_Name, "r+")
A_acc = amazon_File.readline().rstrip('\n')
try:Amazon_mail,Amazon_password = A_acc.split(":")
except:Amazon_mail,Amazon_password = A_acc,A_acc
if A_acc == ' ' or A_acc == '':getErr()
N+=1
except:
os.system("cls")
print(Fore.RED+'[BOT]:'+Fore.BLUE+'Finshed: '+Fore.CYAN+"no amazon")
print(Style.BRIGHT + Fore.GREEN+f'[{D}] Done')
print(Style.BRIGHT + Fore.RED+f'[{E}] Errs')
print('retring...');time.sleep(1)
continue

#GetUserInfo
while True:
try:
usernm = fake.user_name()
addrs = fake.address().split(',')
street = addrs[0].split('\n')[0]
city = addrs[0].split('\n')[1]
state = addrs[0].split('\n')[1]
zipcode = str(random.randint(10000,99999))
phoneN = fake.phone_number().replace('x','1'); break
except:pass

#GET PNONE
try:
if nNum == nMax: tel,tid = GetPhoenNumber(); nNum = 0
except:
os.system("cls")
print(Fore.RED+'[BOT]:'+Fore.CYAN+'CANT GET PHONE NUM !')
print(Style.BRIGHT + Fore.GREEN+f'[{D}] Done')
print(Style.BRIGHT + Fore.RED+f'[{E}] Errs')
print('retrying')
continue

#driver
scn = int(__file__.split('\\')[-2])
rX,rY = int (GetSystemMetrics(0)/3),int (GetSystemMetrics(1)/2)
if scn < 4:pX = scn; pY = 1
else:pX = scn-3; pY = 2
if brser == 'A' or brser == 'a':driver =
webdriver.Chrome(options=chrome_options)
if brser == 'B' or brser == 'b':driver =
webdriver.Edge(options=chrome_options)
if brser == 'C' or brser == 'c':driver =
webdriver.Firefox(options=chrome_options)
act = ActionChains(driver)
driver.set_window_size(rX,rY)
driver.set_window_position(((pX-1)*rX)+0, (pY-1)*rY)

###################################################################################

#Counter
os.system('cls');Aa=cntlns("./Inputs/amazon.txt")
print(Style.BRIGHT + Fore.BLUE+ f"[{Aa}] | " +Fore.MAGENTA+ f"[{N}]
"+Amazon_mail)
print(Style.BRIGHT + Fore.GREEN+f'[{D}] Done')
print(Style.BRIGHT + Fore.RED+f'[{E}] Errs')

###################################################################################

#SIGN IN
# driver.get("https://gaming.amazon.com/loot/leagueoflegends?
ingress=amzn&primeSignupMarketplace=ARBP9OOSHTCHU&ref_=SM_LOL11_P5_CRWN")
driver.get("https://gaming.amazon.com/prime/signup/uk?ingress=amzn-dp
%3Aamzn1.pg.item.c0786a27-0e04-471c-9aa4-
a0531aa894a7&ref_=SM_LOL13_P4_CRWN&urlSlug=prime-gaming-capsule-june-
23&ref_=sm_w_ics_m_f_all")
SignIn("co.uk")
print(1)
if "Account locked" in driver.page_source:getErr()
if "We cannot find an account with that email address" in
driver.page_source:getErr()
##############################################################
for zz in range(15):
time.sleep(0.2)
try:addM =
driver.find_element(By.XPATH,'//*[@id="a-page"]/div[1]/div/div[6]/div/div/h4').text
except:addM = 'aa'
if addM == 'Add your mobile number to enable Prime Gaming.':break
# driver.get("https://gaming.amazon.com/prime/status/wait?ingress=amzn
%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU")

driver.execute_script("window.open('https://gaming.amazon.com/prime/
status/wait?ingress=amzn%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU')")
driver.switch_to.window(driver.window_handles[1])
driver.execute_script("window.open('https://gaming.amazon.com/prime/
status/wait?ingress=amzn%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU')")
driver.switch_to.window(driver.window_handles[2])
driver.execute_script("window.open('https://gaming.amazon.com/prime/
status/wait?ingress=amzn%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU')")
driver.switch_to.window(driver.window_handles[3])

driver.switch_to.window(driver.window_handles[0])

driver.get("chrome-extension://ocdihnbolfodolbhofgokcigdoffogji/index.html")
driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/div[2]/div/
div[1]/div/div/div/div[2]/div/div/div/div[2]/div/div/input').send_keys("-1")
driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/div[2]/div/
div[1]/div/div/div/div[2]/div/div/div/div[3]/div/div/input').send_keys("-99")
driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/div[2]/div/
div[2]/div/div/div/div[2]/div/div/div/div[2]/div/div/input').send_keys("-1")
driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/div[2]/div/
div[2]/div/div/div/div[2]/div/div/div/div[3]/div/div/input').send_keys("-
99");time.sleep(0.1)
driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/div[2]/div/
div[1]/div/div/div/div[1]/div[2]/div/button').click();time.sleep(0.5)
driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/div[2]/div/
div[2]/div/div/div/div[1]/div[2]/div/button').click()
driver.get("https://gaming.amazon.com/prime/status/wait?ingress=amzn%3Aamp-
brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU")
driver.switch_to.window(driver.window_handles[1])
driver.get("https://gaming.amazon.com/prime/status/wait?ingress=amzn%3Aamp-
brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU")

########################################################
driver.switch_to.window(driver.window_handles[2]) #
addPhoneNUM() #
driver.switch_to.window(driver.window_handles[3]) #
########################################################

for i in range(1):
driver.execute_script("window.open('https://gaming.amazon.com/prime/
status/wait?ingress=amzn%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU')")
driver.switch_to.window(driver.window_handles[3])

#activate
# for _ in range(2):
# driver.switch_to.window(driver.window_handles[4])
# driver.get("https://gaming.amazon.com/prime/status/wait?ingress=amzn
%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU")
# driver.switch_to.window(driver.window_handles[3])
# driver.get("https://gaming.amazon.com/prime/status/wait?ingress=amzn
%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU")
# # driver.switch_to.window(driver.window_handles[2])
# # driver.get("https://gaming.amazon.com/prime/status/wait?
ingress=amzn%3Aamp-brawlhalla&primeSignupMarketplace=ARBP9OOSHTCHU")
# if 'Prime Gaming Capsule' in driver.page_source:break

clmT = 0
for zz in range(10):
if 'Prime Gaming Capsule' in driver.page_source:break
# time.sleep(2)
# driver.refresh()

if driver.title == "Prime Gaming":time.sleep(2)


time.sleep(1)

if 'Prime Gaming Capsule' in driver.page_source:break

try:addM =
driver.find_element(By.XPATH,'//*[@id="a-page"]/div[1]/div/div[6]/div/div/h4').text
except:addM = 'aa'
try:ohNo =
driver.find_element(By.XPATH,'//*[@id="a-page"]/div[1]/div/div[4]/div/div/h4').text
except:ohNo = 'aa'
if ohNo == 'Oh no! We can’t enable Prime Gaming on your account.':
driver.find_element(By.XPATH,"youpi").click()

if addM == 'Add your mobile number to enable Prime Gaming.':


if zz == 3 :
requests.get(f"https://smshub.org/stubs/handler_api.php?
api_key=APIKEY&action=setStatus&id={tid}&status={8}&lang=en")
tel,tid = GetPhoenNumber(); nNum = 0
########################################################
driver.switch_to.window(driver.window_handles[2]) #
addPhoneNUM() #
driver.switch_to.window(driver.window_handles[3]) #
########################################################
driver.refresh()

else:clmT = clmT + 1

driver.get('https://gaming.amazon.com/home')
time.sleep(1)
if 'Try Prime' in driver.page_source or "Activate Prime Gaming" in
driver.page_source:print(dffd)
tkn = driver.get_cookie('x-main')
json_str = json.dumps(tkn)
token = json.loads(json_str)['value']
addToNote('tokens.txt', A_acc+'_:_'+token)

end("done"); D+=1
except:
end("err"); E+=1; EE+=1

# try:
# driver.switch_to.window(driver.window_handles[4]); driver.close()
# driver.switch_to.window(driver.window_handles[3]); driver.close()
# driver.switch_to.window(driver.window_handles[2]); driver.close()
# driver.switch_to.window(driver.window_handles[1]); driver.close()
# except:pass
# driver.switch_to.window(driver.window_handles[0])
# driver.get("chrome://settings/clearBrowserData"); time.sleep(0.3)
# try:driver.find_element(By.ID,"clearBrowsingDataConfirm").click()
# except:input("gg")
driver.quit()

You might also like