From 11860acbac7422408028616b3e3aeec43be79c2c Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Sun, 3 Dec 2023 19:43:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug=20#34?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/command.py | 4 +++- pywxdump/wx_info/get_wx_db.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pywxdump/command.py b/pywxdump/command.py index ad22a17..1bc762b 100644 --- a/pywxdump/command.py +++ b/pywxdump/command.py @@ -237,7 +237,9 @@ class MainAll(): wxid = user.get("wxid", None) WxDbPath = get_wechat_db('all', None, wxid=wxid, is_logging=True) # 获取微信数据库路径 - + if isinstance(WxDbPath, str): # 如果返回的是字符串,则表示出错 + print(WxDbPath) + return wxdbpaths = [path for user_dir in WxDbPath.values() for paths in user_dir.values() for path in paths] if len(wxdbpaths) == 0: print("[-] 未获取到数据库路径") diff --git a/pywxdump/wx_info/get_wx_db.py b/pywxdump/wx_info/get_wx_db.py index e920e56..cf571b1 100644 --- a/pywxdump/wx_info/get_wx_db.py +++ b/pywxdump/wx_info/get_wx_db.py @@ -34,7 +34,7 @@ def get_wechat_db(require_list: Union[List[str], str] = "all", msg_dir: str = No msg_dir = os.path.join(w_dir, "WeChat Files") if not os.path.exists(msg_dir): - error = "[-] 目录不存在" + error = f"[-] 目录不存在: {msg_dir}" if is_logging: print(error) return error @@ -63,7 +63,7 @@ def get_wechat_db(require_list: Union[List[str], str] = "all", msg_dir: str = No for require in require_list: pattern[require] = re.compile(r"%s.*\.db$" % require) else: - error = "[-] 参数错误" + error = f"[-] 参数错误: {require_list}" if is_logging: print(error) return error