pywidevine/pywidevine/utils.py
rlaphoenix 36c83268c3 Add Widevine CDM Class
Please note that this CDM implementation isn't inherently secure. For more information see the README about Key and Output Security.

Also adds a utility to get an absolute path to something in the environment PATH, by multiple names, if found.
2022-07-20 14:41:42 +01:00

13 lines
296 B
Python

import shutil
from pathlib import Path
from typing import Optional
def get_binary_path(*names: str) -> Optional[Path]:
"""Get the path of the first found binary name."""
for name in names:
path = shutil.which(name)
if path:
return Path(path)
return None