d60 / twikit

Twitter API Scraper | Without an API key | Twitter Internal API | Free | Twitter scraper | Twitter Bot

Home Page:https://twikit.readthedocs.io/en/latest/twikit.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth with 2FA

milkliker opened this issue · comments

Hi, my accounts uses 2FA, so is that possible to login?
like use cookie or token instead of username/password.

commented

@milkliker

You can log in by passing the TOTP secret key to the login function:

client.login(
    auth_info_1='...',
    auth_info_2='...',
    password='...',
    totp_secret='your-secret-key'
)

Alternatively, you can log in by setting cookies directly in the client:

cookies = {
    ...
}
client.set_cookies(cookies)

@d60 Cool! I'm checking it out. Thanks!