d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot
https://twikit.readthedocs.io/en/latest/twikit.html
MIT License
1.51k stars 176 forks source link

Client.login() got an unexpected keyword argument #232

Closed Moineau54 closed 1 month ago

Moineau54 commented 1 month ago

Anyone know how to fix this:

Client.login() got an unexpected keyword argument 'username'
Traceback (most recent call last):
  File "/home/kali/Documents/Programming/twitter_tool/main.py", line 30, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/kali/Documents/Programming/twitter_tool/main.py", line 24, in main
    await client.login(
Moineau54 commented 1 month ago

Fixed it. Just copy that:

async def main():
    await client.login(
        auth_info_1=USERNAME ,
        auth_info_2=EMAIL,
        password=PASSWORD
    )

and adapt it to your needs