Skip to content

cli.main: use *_args, **_kwargs for create_http_server #3450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
cli.main: use *_args, **_kwargs for create_http_server
  • Loading branch information
back-to committed Dec 26, 2020
commit 10495e36d1ed9ebfd7a0e5ad5639ffd4a8253632
8 changes: 4 additions & 4 deletions src/streamlink_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def create_output(plugin):
except OSError as err:
console.exit("Failed to create pipe: {0}", err)
elif args.player_http:
http = create_http_server("127.0.0.1")
http = create_http_server()

title = create_title(plugin)

Expand All @@ -122,7 +122,7 @@ def create_output(plugin):
return out


def create_http_server(host=None, port=0):
def create_http_server(*_args, **_kwargs):
"""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,
Expand All @@ -131,7 +131,7 @@ def create_http_server(host=None, port=0):

try:
http = HTTPServer()
http.bind(host=host, port=port)
http.bind(*_args, **_kwargs)
except OSError as err:
console.exit("Failed to create HTTP server: {0}", err)

Expand Down Expand Up @@ -178,7 +178,7 @@ def output_stream_http(plugin, initial_streams, external=False, port=0):
"executable with --player.")

title = create_title(plugin)
server = create_http_server(host="127.0.0.1")
server = create_http_server()
player = output = PlayerOutput(args.player, args=args.player_args,
filename=server.url,
quiet=not args.verbose_player,
Expand Down