我的代码:
import requests
from time import sleep
from colorama import Fore
file = [line.rstrip('\n') for line in open('myusername.txt')]
count = 0
URL = "https://127.0.0.1/ajax/attempt/"
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'}
for username in file:
count += 1
data = {
'firstname':'firstname',
'lastname' : 'lastname',
'username': username
}
r = requests.post(url = URL, headers=headers, data = data)
responde = r.text
print(responde)
if ('error_type' in responde):
print('{}[+]Trying ({}/{}) -{}{} Username: {} Taken{}'.format(Fore.WHITE, count, len(file), Fore.RESET, Fore.RED, username, Fore.RESET))
elif ('account_valid' in responde):
print('{}[+]Trying ({}/{}) -{}{} Username: {} Available{}'.format(Fore.WHITE, count, len(file), Fore.RESET, Fore.GREEN, username, Fore.RESET))
elif ('Please wait a few minutes before you try again.' in responde):
sleep(30)
print('{}[+]Waiting 30Sec for recheck ...{}'.format(Fore.YELLOW, Fore.RESET))
当我的程序看到responde Please wait a few minutes before you try again它时,等待 30 秒并重试。
但问题是,它会在服务器繁忙时绕过该用户名,并为下一个用户尝试。
我希望在等待后出现服务器忙时,使用同一用户重试并继续..
相关分类