MCPcopy Create free account
hub / github.com/CScorza/IntelOSINT / _dataurl_to_temp_file

Function _dataurl_to_temp_file

IntelOSINT.py:19382–19397  ·  view source on GitHub ↗
(data_url: str, out_path: Path)

Source from the content-addressed store, hash-verified

19380 request_report = bool(d.get('request_report', False))
19381
19382 def _dataurl_to_temp_file(data_url: str, out_path: Path):
19383 if not isinstance(data_url, str):
19384 return False
19385 if "," not in data_url:
19386 return False
19387 _, payload = data_url.split(",", 1)
19388 try:
19389 raw = base64.b64decode(payload)
19390 except Exception:
19391 return False
19392 try:
19393 out_path.parent.mkdir(parents=True, exist_ok=True)
19394 out_path.write_bytes(raw)
19395 return out_path.exists()
19396 except Exception:
19397 return False
19398
19399 def _compute_face_hashes(file_path: Path):
19400 md5_h = hashlib.md5()

Callers 1

_build_face_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected