You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚨 Account Lockout After Posting a Tweet: Is it My Code or an API Issue?
📝 Problem Description
I am encountering an account lockout immediately after trying to post a tweet using the Twikit library. Below is the code that I'm executing. I would appreciate any insights on whether this is due to my code, or if there is an issue with the Twikit API or Twitter’s restrictions.
❓ My Question
Is my usage of the API incorrect, leading to the lockout?
Is there a limitation on the API side that I might be triggering?
Any help on identifying the cause would be appreciated!
⚙️ Code Example
importasynciofromtwikit.client.clientimportClientasyncdeflogin_with_cookies(client, username, email, password, cookies_file='cookies.json'):
try:
client.load_cookies(cookies_file)
exceptFileNotFoundError:
awaitclient.login(auth_info_1=username, auth_info_2=email, password=password)
client.save_cookies(cookies_file)
asyncdefcreate_tweet(client, text):
awaitclient.create_tweet(text=text)
asyncdefmain():
username="your_username"email="[email protected]"password="your_password"cookies_file=f'cookies_{username}.json'client=Client(
user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36'
)
awaitlogin_with_cookies(client, username, email, password, cookies_file)
awaitcreate_tweet(client, "Hey, it's my first tweet!")
awaitclient.logout()
if__name__=="__main__":
asyncio.run(main())
The text was updated successfully, but these errors were encountered:
🚨 Account Lockout After Posting a Tweet: Is it My Code or an API Issue?
📝 Problem Description
I am encountering an account lockout immediately after trying to post a tweet using the Twikit library. Below is the code that I'm executing. I would appreciate any insights on whether this is due to my code, or if there is an issue with the Twikit API or Twitter’s restrictions.
❓ My Question
Any help on identifying the cause would be appreciated!
⚙️ Code Example
The text was updated successfully, but these errors were encountered: