Last active
December 14, 2018 06:35
-
-
Save davidlc9113/5d1f59dc09d87894d5e9ad74e3f2c4e7 to your computer and use it in GitHub Desktop.
Get Google Authenticator code by secret key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| Install dependencies from https://gist.github.com/dlc9113/eb2b7410b105858bbbed8d80d9a5217d | |
| # Output the code | |
| $ googleauth your_secret_key | |
| # (Mac only) Copy the code | |
| $ googleauth your_secret_key | pbcopy | |
| """ | |
| import pyotp, sys | |
| secret_code = sys.argv[-1] | |
| print(pyotp.TOTP(secret_code).now()) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install dependencies from https://gist.github.com/dlc9113/eb2b7410b105858bbbed8d80d9a5217d