Skip to content

Instantly share code, notes, and snippets.

@chrippa
Created December 30, 2012 16:40
Show Gist options
  • Save chrippa/4413714 to your computer and use it in GitHub Desktop.
Save chrippa/4413714 to your computer and use it in GitHub Desktop.
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py
index a30b58f..a60b184 100644
--- a/src/livestreamer/cli.py
+++ b/src/livestreamer/cli.py
@@ -62,6 +62,8 @@ outputopt.add_argument("-O", "--stdout", action="store_true",
streamopt = parser.add_argument_group("stream options")
streamopt.add_argument("-c", "--cmdline", action="store_true",
help="Print command-line used internally to play stream, this may not be available on all streams")
+streamopt.add_argument("--repr", action="store_true",
+ help="Print internal representation of the stream, useful for external programs that wants access to internal parameters")
streamopt.add_argument("-e", "--errorlog", action="store_true",
help="Log possible errors from internal command-line to a temporary file, use when debugging")
streamopt.add_argument("-r", "--rtmpdump", metavar="path",
@@ -279,6 +281,8 @@ def handle_stream(args, streams):
msg(cmdline)
else:
exit("Stream does not use a command-line")
+ elif args.repr:
+ msg(repr(stream))
else:
altstreams = list(filter(lambda k: args.stream + "_alt" in k,
sorted(streams.keys())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment