Skip to content

Error code 398 "We were unable to confirm you're human. Please try again." when using the client.login method. #305

@RafaelFerrao

Description

@RafaelFerrao
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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions