Closed MatthewL246 closed 4 months ago
Whoops, I should have done more research first. Looks like someone already created a 2FA script: https://github.com/zedeus/nitter/issues/1155#issuecomment-1951602687
It would still be nice to add 2FA support information to the guide here though!
I added basic support for 2fa code. The caveats are that you have to deploy fast enough for the mfa code to not expire. https://github.com/sekai-soft/nitter/commit/06c95a8537825c7e43df163ffb4f71e628fa4957
After about a month of using Nitter with an account with 2FA disabled, my account got locked and I had to log in and complete a captcha to unlock it. The notification said that enabling 2FA would prevent this locking from happening, so I did so.
I looked for a version of the auth token generation script that supports 2FA, but it didn't seem like anyone had created one yet. This uses the TOTP secret key from Twitter's "authentication app" 2FA option. Note that saving the TOTP secret key that is shown when enabling 2FA is required, so accounts with 2FA already enabled will need to disable and re-enable it.
AI Disclosure: This script was generated using ChatGPT, prompted with the original script from https://github.com/zedeus/nitter/issues/983#issuecomment-1914616663. It worked completely fine for me, but I am by no means familiar enough with the Twitter API to review the code's accuracy. I just wanted to post this in case someone else finds it useful and see if it could potentially be integrated into the great setup guide here.