Automate totp login using python module - pyotp
-
- Install pyotp using pip3
'pip3 install pyotp'
-
To get totp
totp = pyotp.parse_uri('angel totp uri') totp = totp.now() print(totp)
-
To get 'angel totp uri', scan QR (which generate after login at https://smartapi.angelbroking.com/enable-totp) using camera or QR code app.
Enjoy!
-
-
@whemant update the smartapi with command pip install smartapi-python --upgrade
-
@SSumit That great. Thanks for this.
I am getting another errorTypeError: SmartConnect.generateSession() takes 3 positional arguments but 4 were given
Any idea how to fix this?
-
@Rushey17 Yes that also works
-
You can also try this code to get totp,
import pyotp
totp = pyotp.TOTP("YOUR26DIGITCODE")
print(totp.now())Find this doc to get more details about how to use pyotp module,
https://pyauth.github.io/pyotp/
1 out of 6