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