diff --git a/lbrynet/lbrynet_daemon/LBRYDaemon.py b/lbrynet/lbrynet_daemon/LBRYDaemon.py index 092f3120f..e2582f6c7 100644 --- a/lbrynet/lbrynet_daemon/LBRYDaemon.py +++ b/lbrynet/lbrynet_daemon/LBRYDaemon.py @@ -100,6 +100,7 @@ class LBRYDaemon(xmlrpc.XMLRPC): def _disp_startup(): print "Started LBRYnet daemon" + print "The daemon can be shut down by running 'stop-lbrynet-daemon' in a terminal" return defer.succeed(None) d = defer.Deferred() @@ -572,7 +573,7 @@ class LBRYDaemon(xmlrpc.XMLRPC): print str(err.getTraceback()) return err d = defer.Deferred() - d.addCallback(lambda _: webbrowser.open("https://cdn.rawgit.com/jackrobison/lbry.io/local/view/page/demo.html")) + d.addCallback(lambda _: webbrowser.open("file://" + str(os.path.join(self.download_directory, "lbryio/view/page/gui.html")))) d.addErrback(_disp_err) d.callback(None) diff --git a/lbrynet/lbrynet_daemon/LBRYURIHandler/LBRYURIHandler.py b/lbrynet/lbrynet_daemon/LBRYURIHandler/LBRYURIHandler.py index e4e66a500..62ded697b 100644 --- a/lbrynet/lbrynet_daemon/LBRYURIHandler/LBRYURIHandler.py +++ b/lbrynet/lbrynet_daemon/LBRYURIHandler/LBRYURIHandler.py @@ -16,42 +16,44 @@ def main(args): daemon = xmlrpclib.ServerProxy('http://localhost:7080/') try: - b = daemon.get_balance() + balance = daemon.get_balance() is_running = True + if len(args) > 1: + print 'Too many args', args + + elif is_running: + if args[0][7:] == 'lbry': + daemon.render_gui() + + elif args[0][7:] == 'settings': + r = daemon.get_settings() + html = "" + json.dumps(r) + "" + r = daemon.render_html(html) + else: + if float(balance) > 0.0: + r = daemon.get(args[0][7:]) + print r + path = r['path'] + if path[0] != '/': + path = '/' + path + + print path + filename = path.split('/')[len(path.split('/')) - 1] + extension = path.split('.')[len(path.split('.')) - 1] + + if extension in ['mp4', 'flv', 'mov']: + html = render_video(path) + daemon.render_html(html) + + else: + webbrowser.open('file://' + str(path)) + except: webbrowser.open('http://lbry.io/get') is_running = False - if len(args) > 1: - print 'Too many args', args - elif is_running: - if args[0][7:] == 'lbry': - daemon.render_gui() - - elif args[0][7:] == 'settings': - r = daemon.get_settings() - html = "" + json.dumps(r) + "" - r = daemon.render_html(html) - - else: - r = daemon.get(args[0][7:]) - print r - path = r['path'] - if path[0] != '/': - path = '/' + path - - print path - filename = path.split('/')[len(path.split('/')) - 1] - extension = path.split('.')[len(path.split('.')) - 1] - - if extension in ['mp4', 'flv', 'mov']: - html = render_video(path) - daemon.render_html(html) - - else: - webbrowser.open('file://' + str(path)) if __name__ == "__main__": - main(sys.argv[1:]) \ No newline at end of file + main(sys.argv[1:])