MCPcopy Create free account
hub / github.com/OpenOSINT/OpenOSINT / parse_targets

Function parse_targets

openosint/multi_target.py:31–42  ·  view source on GitHub ↗

Parse a target list from *source*. If *source* is the path of an existing file, read one target per line. Otherwise treat *source* as comma-separated inline targets.

(source: str)

Source from the content-addressed store, hash-verified

29
30
31def parse_targets(source: str) -> list[str]:
32 """
33 Parse a target list from *source*.
34
35 If *source* is the path of an existing file, read one target per line.
36 Otherwise treat *source* as comma-separated inline targets.
37 """
38 p = Path(source)
39 if p.exists() and p.is_file():
40 lines = p.read_text(encoding="utf-8").splitlines()
41 return [ln.strip() for ln in lines if ln.strip()]
42 return [t.strip() for t in source.split(",") if t.strip()]
43
44
45async def _investigate_one(

Callers 5

_handle_multiFunction · 0.90

Calls

no outgoing calls