Skip to content
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

cli: add --player-env argument #5535

Merged
merged 2 commits into from Sep 5, 2023

Conversation

bastimeyer
Copy link
Member

Resolves #5530

This adds the --player-env KEY=VALUE CLI argument, which allows adding environment variables to the spawned player process (on top of the inherited ones). The CLI argument can be repeated for being able to add multiple env vars. As mentioned in #5530, the intended purpose here is to be able to set env vars from the config files.

- Allow setting custom environment variables for the player process
- Keep inherited env vars
- Update tests and add `os_environ` global test fixture
Copy link
Member

@gravyboat gravyboat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a benefit to adding this as the use cases are extremely slim and environment variables are easily managed via rc files. If an application is setting a dynamic value for something such as a port (which is already bad behavior on the application's part as typically a default port would be configured via the application's config file) then the application should be setting the environment variable appropriately when the service spins up and the random port is allocated if that port is needed for whatever reason.

That being said as there are no real standards around environment variable usage or expectations and there's little negative impact on Streamlink by adding this. I'll mark it as approved with the caveat that we offer as little support for this feature as possible. People should use wrapper scripts in most situations.

@bastimeyer bastimeyer merged commit c6cd719 into streamlink:master Sep 5, 2023
22 checks passed
@bastimeyer bastimeyer deleted the cli/argparse/player-env branch September 5, 2023 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow setting environment variables when launching the player
2 participants