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
218 | 218 | |
219 | 219 | cmd += ["-o", outfile] |
220 | 220 | |
221 | env = os.environ.copy() | |
222 | env.update(config.settings.profile.get("env", {})) | |
223 | ||
221 | 224 | logger.debug("Running cmd: %s" % " ".join(cmd)) |
222 | 225 | 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')) | |
223 | 230 | return proc |
224 | 231 | |
225 | 232 |