MCPcopy Create free account
hub / github.com/MearaY/StegaPy / cmd_extract

Function cmd_extract

cli.py:76–93  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

74
75
76def cmd_extract(args):
77 from StegaPy import StegaPy
78 plugin, cfg = _make_lsb_plugin(
79 algo=args.algo,
80 bits=1,
81 password=args.password,
82 compress=True, # 从数据头读取,此处仅作占位
83 encrypt=bool(args.password),
84 )
85 sp = StegaPy(plugin, cfg)
86
87 stego = _read(args.input)
88 fname, data = sp.extract_data(stego, os.path.basename(args.input))
89
90 out_dir = args.output or os.path.dirname(os.path.abspath(args.input))
91 out_path = os.path.join(out_dir, fname or 'extracted_data')
92 _write(out_path, data)
93 print(f"提取完成 → {out_path} ({len(data)/1024:.1f} KB)")
94
95
96def cmd_wm_embed(args):

Callers 2

mainFunction · 0.85
run_interactiveFunction · 0.85

Calls 5

extract_dataMethod · 0.95
_make_lsb_pluginFunction · 0.85
StegaPyClass · 0.85
_readFunction · 0.85
_writeFunction · 0.85

Tested by

no test coverage detected