Error code 398 "We were unable to confirm you're human. Please try again." when using the client.login method.
from twikit import Client
from configparser import ConfigParser
MINIMUM_TWEETS = 10
QUERY = 'python'
# Read login credentials from config file
config = ConfigParser()
config.read('config.ini')
username = config['Twitter']['username']
password = config['Twitter']['password']
email = config['Twitter']['email']
async def main():
# Authenticate to X.com
client = Client(language='en-US')
await client.login(auth_info_1=username, auth_info_2=email, password=password)
# Get Tweets
tweets = await client.search_tweet(QUERY, product='Top', count=MINIMUM_TWEETS)
# Look at Tweets
print(tweets)
# Run the event loop
asyncio.run(main())
File "c:\Users*******\Documents\python\test.py", line 18, in main await client.login(auth_info_1=username, auth_info_2=email, password=password)
Any ideas? Didn't find this error anywhere in the issues. (and trust me, my credentials are okay).
full traceback please
Sure, hope it helps you
python -u "c:*\python\test.py"
Traceback (most recent call last):
File "c:*\python\test.py", line 27, in
return await self.request('POST', url, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:**********\python\env\Lib\site-packages\twikit\client\client.py", line 186, in request
raise BadRequest(message, headers=response.headers)
twikit.errors.BadRequest: status: 400, message: "{"errors":[{"code":398,"message":"We were unable to confirm you're human. Please try again.
g;173923906507773664:-1739239065296:ho6kxextUrtKMT0L5yPYPcCM:5"}]}"
reset password and it should work @RafaelFerrao