Created
December 30, 2012 22:57
-
-
Save chrippa/4415832 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/livestreamer/cli.py b/src/livestreamer/cli.py | |
index a60b184..d0148dd 100644 | |
--- a/src/livestreamer/cli.py | |
+++ b/src/livestreamer/cli.py | |
@@ -310,9 +310,21 @@ def handle_url(args): | |
if len(streams) == 0: | |
exit("No streams found on this URL: {0}", args.url) | |
- keys = list(streams.keys()) | |
- keys.sort() | |
- validstreams = (", ").join(keys) | |
+ validstreams = [] | |
+ for name, stream in sorted(streams.items()): | |
+ if name in ("best", "worst"): | |
+ continue | |
+ | |
+ synonyms = list(filter(lambda n: stream is streams[n] and n is not name, | |
+ streams.keys())) | |
+ | |
+ if len(synonyms) > 0: | |
+ joined = ", ".join(synonyms) | |
+ name = "{0} ({1})".format(name, joined) | |
+ | |
+ validstreams.append(name) | |
+ | |
+ validstreams = ", ".join(validstreams) | |
if args.stream: | |
if args.stream == "best" or args.stream == "worst": |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment