cli.main: use *_args, **_kwargs for create_http_server#3450
Conversation
closes streamlink#2622 use `127.0.0.1` for local `create_http_server()` use `0.0.0.0` for external `create_http_server()` `--player-http` = ***127.0.0.1*** https://streamlink.github.io/cli.html#cmdoption-player-http `--player-continuous-http` = ***127.0.0.1*** https://streamlink.github.io/cli.html#cmdoption-player-continuous-http `--player-external-http` = ***None*** / ***0.0.0.0*** https://streamlink.github.io/cli.html#cmdoption-player-external-http --- we use `AF_INET` which is IPv4 https://github.com/streamlink/streamlink/blob/2.0.0/src/streamlink_cli/utils/http_server.py#L24 we don't use `AF_INET6` which is IPv6, so IPv6 support is unimportant. Ref streamlink#2622 (comment) --- ``` $ streamlink https://www.youtube.com/channel/UCSrZ3UV4jOidv8ppoVuvW9Q/live --player-http -l debug ... [cli][info] Starting player: /usr/bin/mpv [cli.output][debug] Opening subprocess: /usr/bin/mpv "--force-media-title=Euronews English Live" http://127.0.0.1:35085/ ``` ``` $ streamlink https://www.youtube.com/channel/UCSrZ3UV4jOidv8ppoVuvW9Q/live --player-continuous-http -l debug ... [cli][info] Starting player: /usr/bin/mpv [cli.output][debug] Opening subprocess: /usr/bin/mpv "--force-media-title=Euronews English Live" http://127.0.0.1:39099/ [cli][info] Got HTTP request from libmpv ``` ``` $ streamlink https://www.youtube.com/channel/UCSrZ3UV4jOidv8ppoVuvW9Q/live --player-external-http --player-external-http-port 33333 [cli][info] Starting server, access with one of: [cli][info] http://127.0.0.1:33333/ [cli][info] http://127.0.0.53:33333/ [cli][info] http://127.0.1.1:33333/ [cli][info] Got HTTP request from Mozilla/5.0 ... [cli][info] Opening stream: 720p (hls) ```
|
Just remove the default parameter values in streamlink/src/streamlink_cli/main.py Lines 125 to 134 in 374130a When --player-external-http is True, streamlink/src/streamlink_cli/main.py Lines 170 to 201 in 374130a |
well it is never called, that is basically the issue because None will overwrite it.
I could, but we would need to use always host and port
|
|
Just pass the |
…mlink#3450) use `127.0.0.1` for local `create_http_server()` use `0.0.0.0` for external `create_http_server()` `--player-http` = ***127.0.0.1*** https://streamlink.github.io/cli.html#cmdoption-player-http `--player-continuous-http` = ***127.0.0.1*** https://streamlink.github.io/cli.html#cmdoption-player-continuous-http `--player-external-http` = ***None*** / ***0.0.0.0*** https://streamlink.github.io/cli.html#cmdoption-player-external-http
closes #2622
use
127.0.0.1for localcreate_http_server()use
0.0.0.0for externalcreate_http_server()--player-http= 127.0.0.1https://streamlink.github.io/cli.html#cmdoption-player-http
--player-continuous-http= 127.0.0.1https://streamlink.github.io/cli.html#cmdoption-player-continuous-http
--player-external-http= None / 0.0.0.0https://streamlink.github.io/cli.html#cmdoption-player-external-http
we use
AF_INETwhich is IPv4https://github.com/streamlink/streamlink/blob/2.0.0/src/streamlink_cli/utils/http_server.py#L24
we don't use
AF_INET6which is IPv6, so IPv6 support is unimportant.Ref #2622 (comment)