Created
June 28, 2020 13:39
-
-
Save nick133/533311bd28b7ba9885e4de1c89d489a5 to your computer and use it in GitHub Desktop.
GoogleAuthentificator (OTP-generator) for linux command line (python)
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/python3 | |
# | |
# Command line GoogleAuthentificator for linux | |
# | |
# pip3 install pyperclip | |
# pip3 install pyotp | |
# | |
import pyperclip | |
import pyotp | |
ga_keys = [ | |
{ "provider": "Binance", | |
"key": "YOURPRIVATEOTPKEY1", | |
}, | |
{ "provider": "Localbitcoins", | |
"key": "YOURPRIVATEOTPKEY2", | |
}, | |
] | |
print("Generate Google Auth code for: [1]") | |
for i in range(len(ga_keys)): | |
print(f"{i+1} - {ga_keys[i]['provider']}") | |
id = int(input() or 1) - 1 | |
code = pyotp.TOTP(ga_keys[id]['key']).now() | |
pyperclip.copy(code) | |
print (f"Code {code} is copied to clipboard\n\nPress <Enter> to exit") | |
id = input() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment