- If 2FA is already enabled on your account, please disable it. (It will be re-enabled later.)
- Install a time-based authenticator such as Authy or Google Authenticator.
- Visit 2FA settings
- Enable 2FA and copy the text below the QR code.
- Save this as a variable, such as
qrbase
- Install
pyotp
using:pip install pyotp
- Use it like so:
from nextdnsapi.api import *
import pyotp
totp = pyotp.TOTP(qrbase)
totp_code = totp.now()
print(totp_code)
header = account.login("[email protected]", "password123", totp_code)