From 7e77c0016bce34bba8fff131d50de842288cee60 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Sun, 4 Feb 2024 15:56:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E8=87=AA=E5=8A=A8=E8=A7=A3=E5=AF=86?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=95=B0=E6=8D=AE=E6=94=B9=E4=B8=BA=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=A7=A3=E5=AF=86=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=80=E6=96=B0=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/api/api.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pywxdump/api/api.py b/pywxdump/api/api.py index ce54c93..02554f6 100644 --- a/pywxdump/api/api.py +++ b/pywxdump/api/api.py @@ -35,9 +35,11 @@ def init(): msg_path = request.json.get("msg_path", "").strip() micro_path = request.json.get("micro_path", "").strip() media_path = request.json.get("media_path", "").strip() + wx_path = request.json.get("wx_path", "").strip() key = request.json.get("key", "").strip() my_wxid = request.json.get("my_wxid", "").strip() + init_type = request.json.get("init_type", "").strip() if init_type == "last": @@ -48,7 +50,7 @@ def init(): save_micro_path): return ReJson(0, {"msg_path": save_msg_path, "micro_path": save_micro_path, "is_init": True}) else: - return ReJson(1002,body="上次初始化的路径不存在") + return ReJson(1002, body="上次初始化的路径不存在") if key: # 如果key不为空,表示是解密模式 if not wx_path: @@ -56,8 +58,10 @@ def init(): if not os.path.exists(wx_path): return ReJson(1001, body=wx_path) - out_path = os.path.join(g.tmp_path, "decrypted", my_wxid) if my_wxid else os.path.join(g.tmp_path, - "decrypted") + out_path = os.path.join(g.tmp_path, "decrypted", my_wxid) if my_wxid else os.path.join(g.tmp_path, "decrypted") + if os.path.exists(out_path): + shutil.rmtree(out_path) + code, merge_save_path = decrypt_merge(wx_path=wx_path, key=key, outpath=out_path) time.sleep(1) if code: