Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
319 stars 32 forks source link

AccountDuplication step of Login flow fails at first attempt. After some attempts, it works as usual #290

Closed Rishikant181 closed 1 year ago

seiya-git commented 1 year ago

For me, it's asking for entering confirmation code and AccountDuplication step will fail because there is no 'Set-Cookie' header

Rishikant181 commented 1 year ago

@seiya-git The issue that this thread addresses has been fixed a long time ago (I forgot to close this, my bad :P).

Coming to your issue, can you login from the browser?

seiya-git commented 1 year ago

@Rishikant181 yes, from browser I can login

Rishikant181 commented 1 year ago

@seiya-git

  1. Does it ever ask for confirmation in the browser?
  2. Which version of this package are you on?
seiya-git commented 1 year ago

@Rishikant181

  1. yes, subtask_id: "LoginAcid"
  2. 1.4.0
seiya-git commented 1 year ago

For entering confirmation code: URL: https://api.twitter.com/1.1/onboarding/task.json body:

{"flow_token":"${FLOWTOKEN}","subtask_inputs":[{"subtask_id":"LoginAcid","enter_text":{"text":"${CONFIRMATIONCODE}","link":"next_link"}}]}
Rishikant181 commented 1 year ago

@seiya-git Logging in too many times is bound to raise suspicions, that's why Twitter might be asking you to confirm whether it really is your account.

The recommended approach is to login once and store the cookies that you get somewhere safe (such as environment variable) and pass on those cookies to Rettiwt from the environment itself.

Remember: The cookies you get after logging in are valid for a year. So, login once and use the same cookies everytime.