Я создаю 300 поток для парсинга, когда 1 поток выполнит условие , мне нужно что бы все остальные потоки прекращались.
def start_requst(productid,item_name,):
while True:
response = requests.post('https://www.binance.com/bapi/nft/v1/friendly/nft/nft-trade/product-detail',
headers={'content-type': 'application/json'}, json={"productId": productid}).json()
if (response['data']) != None:
rsp = (response['data']['productDetail'])
if (rsp['title']) == item_name and float(rsp['amount']) < 18 and rsp['currency'] == 'BUSD' and float(rsp['stepAmount']) == 0:
print(f'https://www.binance.com/ru/nft/goods/blindBox/detail?productId={productid}&isOpen=false&isProduct=1 ' + str((rsp['amount'])+ " " + str(time.time())))
succ_resp = str(productid)
print("Условие выполнено : " + str(productid))
break
elif (rsp['title']) == item_name:
break
else:
print(productid)
break
for productid in reversed(range(first_productid,second_productid)):
my_thread = threading.Thread(target=start_requst, args=(productid,item_name))
my_thread.start()