Conversation
host="127.0.0.1" is already the default parameter value on HTTPServer.bind():
| def bind(self, host="127.0.0.1", port=0): |
Just remove the default parameter values in streamlink_cli.main.create_http_server():
| def create_http_server(host=None, port=0): | |
| """Creates a HTTP server listening on a given host and port. | |
| If host is empty, listen on all available interfaces, and if port is 0, | |
| listen on a random high port. | |
| """ | |
| try: | |
| http = HTTPServer() | |
| http.bind(host=host, port=port) |
When --player-external-http is True, host=None is already set:
| def output_stream_http(plugin, initial_streams, external=False, port=0): | |
| """Continuously output the stream over HTTP.""" | |
| global output | |
| if not external: | |
| if not args.player: | |
| console.exit("The default player (VLC) does not seem to be " | |
| "installed. You must specify the path to a player " | |
| "executable with --player.") | |
| title = create_title(plugin) | |
| server = create_http_server() | |
| player = output = PlayerOutput(args.player, args=args.player_args, | |
| filename=server.url, | |
| quiet=not args.verbose_player, | |
| title=title) | |
| try: | |
| log.info("Starting player: {0}".format(args.player)) | |
| if player: | |
| player.open() | |
| except OSError as err: | |
| console.exit("Failed to start player: {0} ({1})", | |
| args.player, err) | |
| else: | |
| server = create_http_server(host=None, port=port) | |
| player = None | |
| log.info("Starting server, access with one of:") | |
| for url in server.urls: | |
| log.info(" " + url) | |
back-to
changed the title
cli.main: use '127.0.0.1' for --player-http / --player-continuous-http
cli.main: use *_args, **_kwargs for create_http_server