-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors":[{"code":366,"message":"flow name LoginFlow is currently not accessible"}] #251
Comments
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. |
There is a newer version which is still in pull requests, but supposedly solved this problem. 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 |
A lot of people seem to be having the same problem, so here's the solution. Don't log in using the username and password since it's broken. Just use the cookie. You can use a extension like in order to grab the cookies from the browser. However, some extensions tend to return the cookies in a weird format. The cookies, when being passed to Here's my implementation of the post searching example with the cookies I exported using the cookie editor linked above: from twikit import Client
import asyncio
import json
cookies = []
with open(r"./cookies.json",'r') as file:
cookies = json.load(file)
cookies_formatted = {}
for cookie in cookies:
cookies_formatted[cookie["name"]] = cookie["value"]
client = Client("en-US")
async def main():
client.set_cookies(cookies_formatted)
tweets = await client.search_tweet("python",product="Top")
for tweet in tweets:
print(
tweet.user.name,
tweet.text,
tweet.created_at,
)
asyncio.run(main()) p.s. Noticed that #239 has a solution as well. |
this work for me, thank you |
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...
The text was updated successfully, but these errors were encountered: