d60/twikit

errors":[{"code":366,"message":"flow name LoginFlow is currently not accessible"}]

theordev opened this issue · 6 comments

Hey !

Just trying this good project on my debian VPS but I got this twikit.errors.BadRequest: status: 400, message: "{"errors":[{"code":366,"message":"flow name LoginFlow is currently not accessible"}]}" on launch.

I have no problem at all on my own computer. Maybe this is the IP of the vps ? My script got the :

USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36'

twitter_client = Client(user_agent=USER_AGENT)

this is the user agent that i use on my real computer when using twitter.

No idea about what to try...

Login flow is unstable. I recommend to use client.load_cookies() or client.set_cookies(). Cookies are from logged in account of owned pc or VPS.
If you use cookies, user-agent is not necessary.

There is a newer version which is still in pull requests, but supposedly solved this problem.
pip uninstall twikit
pip install git+https://github.com/mdmrcglu/twikit.git

This library should work

And also, some networks of larger corporations (like eduroam in all European schools) block twikit for some reason. Try an other network