修复部分bug #34

This commit is contained in:
xaoyaoo 2023-12-03 19:43:20 +08:00
parent 69ee8e77c1
commit 11860acbac
2 changed files with 5 additions and 3 deletions

View File

@ -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("[-] 未获取到数据库路径")

View File

@ -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