Skip to content

Conversation

@bastimeyer
Copy link
Member

Preferably, --player-external-http should be turned into a non-store_true argument with an argument value for being able to set the interface and port, so --player-external-http-interface and --player-external-http-port could be deprecated and removed eventually, but that would be an unnecessary breaking change. Making the value optional doesn't work either, e.g. when the following argv tokens are positional arguments like the stream URL or stream quality.


I also had a look at adding support for outputting the list of server URLs as JSON data, but I'm not sure how useful it is, considering that --json disables all logging output and considering that the process doesn't terminate after printing the JSON payload and keeps running.


$ streamlink --player-external-http twitch.tv/esl_dota2 best
[cli][info] Found matching plugin twitch for URL twitch.tv/esl_dota2
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
[cli][info] Starting server, access with one of:
[cli][info]  http://127.0.0.1:44083/
[cli][info]  http://172.17.0.1:44083/
[cli][info]  http://192.168.100.1:44083/
[cli][info]  http://192.168.178.99:44083/
^CInterrupted! Exiting...

$ streamlink --player-external-http --player-external-http-interface 0.0.0.0 twitch.tv/esl_dota2 best
[cli][info] Found matching plugin twitch for URL twitch.tv/esl_dota2
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
[cli][info] Starting server, access with one of:
[cli][info]  http://127.0.0.1:43373/
[cli][info]  http://172.17.0.1:43373/
[cli][info]  http://192.168.100.1:43373/
[cli][info]  http://192.168.178.99:43373/
^CInterrupted! Exiting...
$ streamlink --player-external-http --player-external-http-interface 127.0.0.1 twitch.tv/esl_dota2 best
[cli][info] Found matching plugin twitch for URL twitch.tv/esl_dota2
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
[cli][info] Starting server, access with one of:
[cli][info]  http://127.0.0.1:38465/
^CInterrupted! Exiting...

$ streamlink --player-external-http --player-external-http-interface localhost twitch.tv/esl_dota2 best
[cli][info] Found matching plugin twitch for URL twitch.tv/esl_dota2
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
[cli][info] Starting server, access with one of:
[cli][info]  http://127.0.0.1:40993/
^CInterrupted! Exiting...
$ streamlink --player-external-http --player-external-http-interface foo twitch.tv/esl_dota2 best
[cli][info] Found matching plugin twitch for URL twitch.tv/esl_dota2
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
error: Failed to create HTTP server: [Errno -5] No address associated with hostname

$ streamlink --player-external-http --player-external-http-interface 1.1.1.1 twitch.tv/esl_dota2 best
[cli][info] Found matching plugin twitch for URL twitch.tv/esl_dota2
[cli][info] Available streams: audio_only, 160p (worst), 360p, 480p, 720p, 720p60, 1080p60 (best)
error: Failed to create HTTP server: [Errno 99] Cannot assign requested address

@bastimeyer bastimeyer added the CLI label Apr 17, 2023
@gravyboat gravyboat merged commit 5846abd into streamlink:master Apr 17, 2023
@bastimeyer bastimeyer deleted the cli/player-external-http-interface branch April 17, 2023 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants