From 0f3765749001279fe232914bfa852650c4fd1162 Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Wed, 21 Mar 2012 16:24:45 +0100 Subject: Refactor the stream/command line handling. --- src/livestreamer/cli.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/livestreamer/cli.py') diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py index 1965e7e..58c935c 100644 --- a/src/livestreamer/cli.py +++ b/src/livestreamer/cli.py @@ -36,19 +36,19 @@ def handle_url(args): if args.stream: if args.stream in streams: stream = streams[args.stream] - cmdline = plugin.stream_cmdline(stream, args.output or "-") + cmdline = stream.cmdline(args.output or "-") if args.cmdline: - print(cmdline) + print(cmdline.format()) sys.exit() else: if not args.output: - cmdline = ("{0} | {1} -").format(cmdline, args.player) - os.system(cmdline) + cmdline.pipe = ("{0} -").format(args.player) + + os.system(cmdline.format()) else: print(("This channel does not have stream: {0}").format(args.stream)) print(("Valid streams: {0}").format(validstreams)) - sys.exit() else: print(("Found streams: {0}").format(validstreams)) -- cgit v1.2.3