mahrtayyab / tweety

Twitter Scraper
496 stars 67 forks source link

Encountering tweety.exception_.ActionRequired exception repeatedly #183

Closed efemuratucarli closed 5 days ago

efemuratucarli commented 7 months ago

Hello, I have used tweety with an account successfully. After exceeding rate limit with that account I have tried to use tweety with an another account (a new one) but I could not manage to use it with the new account. tweety.exceptions_.ActionRequired exception occurs repeatedly. After this exception, I can log into the account with email verification manually but then, when I try to relogin to the account, twitter does not ask for email verification.

How can I solve this problem ? (I am already using a good proxy)

mahrtayyab commented 7 months ago

Are you using same session name for both accounts?

efemuratucarli commented 7 months ago

I was using same session name. Now, I have changed the session name of the new one but the same exception occurs.

mahrtayyab commented 7 months ago

ActionRequired occurs when when logging in to Twitter/X and it require some information like OTP etc. Are you acting on that?

efemuratucarli commented 6 months ago

I have opened another new Twitter account but ActionRequired occured again. So, I can not use tweety. How can I solve this problem ? (I did not change any of the settings of the Twitter account. After opening the account, I have tried to use it with tweety but ActionRequired occured.

mahrtayyab commented 6 months ago

ActionRequired occurs when when logging in to Twitter/X and it require some information like OTP etc. Are you acting on that?

can you please confirm this?

mahrtayyab commented 6 months ago

from tweety import Twitter

app = Twitter("session")
try:
    app.sign_in(username, password, extra=extra)
except ActionRequired as e:
    action = input(f"Action Required :> {str(e.message)} : ")
    app.sign_in(username, password, extra=action)
efemuratucarli commented 6 months ago

Twitter asks for the email address as an action. I have given the email address as the value of extra parameter of sign_in function but now it returns InvalidCredentials exception.

mahrtayyab commented 6 months ago

Use .start method instead of sign_in, InvalidCredentials after ActionRequired means you have entered wrong email

efemuratucarli commented 6 months ago

I have entered the correct email and used .start method but still getting InvalidCredentials in two different accounts.

mahrtayyab commented 5 months ago

Improved start method in latest update

mahrtayyab commented 5 days ago

https://github.com/mahrtayyab/tweety/commit/650981ce9605e6e06f2c5c1fe2db5c01a5270d2e