Open RisenCrypto opened 2 months ago
client=Client(language="en-US") async def main(): await client.login(auth_info_1=username, auth_info_2=email, password=password) asyncio.run(main())
I am getting the same error even with this. I am working on macos. How to resolve this error.
I have the same issue
same issue here
If you are on Mac replace:
client = Client('en-US')
with
client = Client( user_agent="Put Your User Agent Here" )
If you are on Mac replace:
client = Client('en-US')
with
client = Client( user_agent="Put Your User Agent Here" )
I've used this solution but not still getting the same error. I'm on mac.
My user agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
If you are on Mac replace:
client = Client('en-US')
withclient = Client( user_agent="Put Your User Agent Here" )
I've used this solution but not still getting the same error. I'm on mac. My user agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Can you share your complete code and the complete error, I’ll like to run it and see where the problem is coming from.
let me also ask, did you turn your solution into an asynchronous solution?
If you are on Mac replace:
client = Client('en-US')
withclient = Client( user_agent="Put Your User Agent Here" )
I've used this solution but not still getting the same error. I'm on mac. My user agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Can you share your complete code and the complete error, I’ll like to run it and see where the problem is coming from.
let me also ask, did you turn your solution into an asynchronous solution?
I'm in the same boat, my function is async and it seems like I'm doing everything right. Where can I send you the code?
Here is my code:
import asyncio from twikit import Client, TooManyRequests
Min_tweets = 10
username = 'XXXX' email = 'XXXX' password = 'XXXX'
client= Client( user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' )
print(client)
print('got the client') async def main():
print('entered main')
await client.login(auth_info_1=username, auth_info_2=email, password=password)
tweets = await client.search_tweet('chatGPT', 'Latest')
print(tweets)
for tweet in tweets:
print(tweet.text)
more_tweets = await tweets.next()
print('About to do main')
await main()
If you are on Mac replace:
client = Client('en-US')
withclient = Client( user_agent="Put Your User Agent Here" )
I've used this solution but not still getting the same error. I'm on mac. My user agent is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Can you share your complete code and the complete error, I’ll like to run it and see where the problem is coming from. let me also ask, did you turn your solution into an asynchronous solution?
I'm in the same boat, my function is async and it seems like I'm doing everything right. Where can I send you the code?
Here is my code:
import asyncio from twikit import Client, TooManyRequests
Min_tweets = 10
username = 'XXXX' email = 'XXXX' password = 'XXXX'
client= Client( user_agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36' )
print(client)
print('got the client') async def main():
print('entered main') await client.login(auth_info_1=username, auth_info_2=email, password=password) tweets = await client.search_tweet('chatGPT', 'Latest') print(tweets) for tweet in tweets: print(tweet.text) more_tweets = await tweets.next()
print('About to do main')
await main()
I will try to reproduce your error using your code and drop a feedback here.
Program
Gives an error
If I replace the
client = Client(user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36')
with
client = Client('en-US')
the program works perfectly.
I am on Windows 11.
The reason I need to set the user agent is because twitter keeps giving the "There was a login to your account @xxxx from a new device on Sep 10, 2024. Review it now"
I was trying to set user_agent to avoid this message.
You have a comment - https://github.com/d60/twikit/issues/169#issuecomment-2286465397 which is similar but there this seems to happen without setting user_agent explicitly, whereas in my it happens because I am trying to set it.