INNER CODE UNIT · Python
_parse
renezander030/capcut-cli · python/capcut/__init__.py:169
def _parse(stdout: str) -> Any:
text = stdout.strip()
if not text:
return None
try:
return json.loads(text)
except ValueError:
pass
# Commands print one JSON document; if anything else reached stdout, the document is the last line.
last = text.splitlines()[-1].strip()
try:
return json.loads(last)
except ValueError:
return None
def run_raw(
cmd: str,