lbry-sdk/lbrynet/lbrynet_daemon/LBRYURIHandler/LBRYURIHandler.py
2015-12-09 23:59:19 -05:00

20 lines
No EOL
456 B
Python

import webbrowser
import xmlrpclib, sys
def main(args):
if len(args) == 0:
args.append('lbry://wonderfullife')
daemon = xmlrpclib.ServerProxy('http://localhost:7080/')
if len(args) > 1:
print 'Too many args', args
else:
daemon.download_name(str(args[0])[7:])
path = daemon.path_from_name(args[0][7:])[0]['path']
webbrowser.open('file://' + path)
if __name__ == "__main__":
main(sys.argv[1:])