2015-12-06 23:32:17 +01:00
|
|
|
import webbrowser
|
|
|
|
import xmlrpclib, sys
|
|
|
|
|
|
|
|
|
|
|
|
def main(args):
|
|
|
|
if len(args) == 0:
|
2015-12-10 05:59:19 +01:00
|
|
|
args.append('lbry://wonderfullife')
|
2015-12-06 23:32:17 +01:00
|
|
|
|
|
|
|
daemon = xmlrpclib.ServerProxy('http://localhost:7080/')
|
|
|
|
|
|
|
|
if len(args) > 1:
|
|
|
|
print 'Too many args', args
|
2015-12-10 05:57:58 +01:00
|
|
|
|
2015-12-06 23:32:17 +01:00
|
|
|
else:
|
|
|
|
daemon.download_name(str(args[0])[7:])
|
2015-12-10 05:59:19 +01:00
|
|
|
path = daemon.path_from_name(args[0][7:])[0]['path']
|
2015-12-06 23:32:17 +01:00
|
|
|
webbrowser.open('file://' + path)
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main(sys.argv[1:])
|