Codebase list mlbstreamer / 5a9fe69
Support envionment variables to be set when launching streamlink. * If the active configuration profile has an "env" key, pass the value of that key as the environment for the streamlink subprocess. Tony Cebzanov 5 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
218218
219219 cmd += ["-o", outfile]
220220
221 env = os.environ.copy()
222 env.update(config.settings.profile.get("env", {}))
223
221224 logger.debug("Running cmd: %s" % " ".join(cmd))
222225 proc = subprocess.Popen(cmd, stdout=None if allow_stdout else open(os.devnull, 'w'))
226 proc = subprocess.Popen(
227 cmd,
228 env=env,
229 stdout=None if allow_stdout else open(os.devnull, 'w'))
223230 return proc
224231
225232