mirror of
https://github.com/devine-dl/pywidevine.git
synced 2024-10-30 05:29:21 +00:00
36c83268c3
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.
13 lines
296 B
Python
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
|