Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Google's 2fa (and not only) is essentially just a secret string on the basis of which codes are generated. Install the pyotp library, get your secret string (usually, either the site gives it in its pure form, for use in other applications, or at least gives you the opportunity to generate a QR code that can be read by the camera and get a string from it; an alternative is to open the request logs in browser and generate a new 2fa code, it will be reflected somewhere in the history), then just do
import pyotp
code = pyotp.TOTP(secret_line).now()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question