-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestsend.py
More file actions
37 lines (31 loc) · 941 Bytes
/
testsend.py
File metadata and controls
37 lines (31 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
from nomorepass.core import NoMorePass
import qrcode
import json
import argparse
parser = argparse.ArgumentParser(description='Send password to app')
parser.add_argument('--user', help='username to send')
parser.add_argument('--password', help='password to send')
parser.add_argument('--extra', help='extra to send')
parser.add_argument('site', help='site identification')
args = parser.parse_args()
user = args.user
password = args.password
site = args.site
extra = args.extra
if extra:
extra = json.loads(extra)
else:
extra = {'type':'pwd'}
apikey='FREEAPIKEY' # Change by your own nomorepass apikey
nmp = NoMorePass('api.nomorepass.com',apikey)
qrtext = nmp.getQrSend(site,user,password,extra)
print (qrtext)
img = qrcode.make(qrtext)
img.show()
res = nmp.send()
if ('error' in res):
print ("Error: "+res["error"])
else:
print ("Password received")
print ("Please, close the qr window")