aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Christopher Rosell <chrippa@tanuki.se>2012-05-26 23:30:26 +0200
committerGravatar Christopher Rosell <chrippa@tanuki.se>2012-05-26 23:30:26 +0200
commitabc1ebe65f5e68c377973fa498687881c4263186 (patch)
tree28aebf4893a12b80082c31d91efa0e1268d8fd12
parent7802a2079970057831ecd5d4bf46f96e48d8eb18 (diff)
Add option to output stream to stdout.
-rw-r--r--src/livestreamer/cli.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py
index 8b5ba2d..0a20392 100644
--- a/src/livestreamer/cli.py
+++ b/src/livestreamer/cli.py
@@ -10,6 +10,7 @@ parser.add_argument("url", help="URL to stream", nargs="?")
parser.add_argument("stream", help="stream to play", nargs="?")
parser.add_argument("-p", "--player", metavar="player", help="commandline for player", default="vlc")
parser.add_argument("-o", "--output", metavar="filename", help="write stream to file instead of playing it, use - for stdout")
+parser.add_argument("-O", "--stdout", action="store_true", help="write stream to stdout instead of playing it")
parser.add_argument("-l", "--plugins", action="store_true", help="print installed plugins")
RCFILE = os.path.expanduser("~/.livestreamerrc")
@@ -98,6 +99,8 @@ def handle_url(args):
else:
out = check_output(args.output)
progress = True
+ elif args.stdout:
+ out = stdout
else:
cmd = args.player + " -"
player = pbs.sh("-c", cmd, _bg=True, _out=sys.stdout, _err=sys.stderr)