Open Eitan007 opened 3 weeks ago
async def login_user(client, username, email, password): await client.login(auth_info_1=username, auth_info_2=email, password=password) return client
def save_cookies(client, filename='cookies.json'):
client.save_cookies(filename)
async def main(client, username, email, password): client = await login_user(client, username, email, password) save_cookies(client)
def load_cookies(client, filename='cookies.json'): client.load_cookies(filename)
async def search_user_0(query, count=1): user_profile_results = await client.search_user(query, count,) return user_profile_results
if name == "main":
# login credentials config = ConfigParser() config.read('config.ini') username = config['X']['username'] email = config['X']['email'] password = config['X']['password'] # create client client = Client(language='en-US') # Run the main function with asyncio #asyncio.run(main(client, username, email, password)) load_cookies(client) # # params minimum_users = 1 query = input('Type in username: ') query = f'@{query}' user_profile_results = asyncio.run(search_user_0(query, 1)) #print(user_profile_results) # # get point-zero username profile for user in user_profile_results: print(vars(user)) break
My accounts keep getting locked. does anyone know a way around this?
being using vpn and kept the 'count' param at 20 for search_user()
Define your async function
async def login_user(client, username, email, password): await client.login(auth_info_1=username, auth_info_2=email, password=password) return client
Define the function to handle saving cookies
def save_cookies(client, filename='cookies.json'):
Assuming client.save_cookies is an async function
Main function to run the asynchronous code
async def main(client, username, email, password): client = await login_user(client, username, email, password) save_cookies(client)
def load_cookies(client, filename='cookies.json'): client.load_cookies(filename)
async def search_user_0(query, count=1): user_profile_results = await client.search_user(query, count,) return user_profile_results
if name == "main":
My accounts keep getting locked. does anyone know a way around this?