MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / cmd_export

Function cmd_export

Scripts/Network Tools/Dark.py:1048–1068  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

1046 if not plugins:
1047 print("[!] No plugins loaded.")
1048 return
1049 out = run_plugins(plugins, data)
1050 save_json(f"plugins_out_{int(time.time())}.json", out)
1051 print("[*] Plugins run complete. Saved output.")
1052
1053
1054def cmd_export(args):
1055 path = args.file or input("Path to JSON results file (default last crawl JSON): ").strip()
1056 if not path:
1057 files = [f for f in os.listdir(RESULTS_DIR) if f.startswith("crawl_") and f.endswith(".json")]
1058 files = sorted(files, key=lambda x: os.path.getmtime(os.path.join(RESULTS_DIR, x)), reverse=True)
1059 if not files:
1060 print("[!] No result files found.")
1061 return
1062 path = os.path.join(RESULTS_DIR, files[0])
1063 if not os.path.isfile(path):
1064 print("[!] File not found:", path)
1065 return
1066 try:
1067 with open(path, "r", encoding="utf-8") as f:
1068 data = json.load(f)
1069 except Exception as e:
1070 print("[!] Failed to load JSON:", e)
1071 return

Callers

nothing calls this directly

Calls 4

inputFunction · 0.85
printFunction · 0.85
save_csvFunction · 0.70
save_txtFunction · 0.70

Tested by

no test coverage detected