From 5a3f87417891cc295c29fa8ea916bcb6e58a3796 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 9 Jan 2024 21:11:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AF=BC=E5=87=BA=E7=9A=84cs?= =?UTF-8?q?v=E5=91=BD=E5=90=8D=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/analyzer/export_chat.py | 1 + pywxdump/cli.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pywxdump/analyzer/export_chat.py b/pywxdump/analyzer/export_chat.py index a4bc5b2..bffb001 100644 --- a/pywxdump/analyzer/export_chat.py +++ b/pywxdump/analyzer/export_chat.py @@ -229,6 +229,7 @@ def export_csv(username, outpath, MSG_ALL_db_path, page_size=5000): start_index = i data = get_msg_list(MSG_ALL_db_path, username, start_index, page_size) if len(data) == 0: + return False, "没有聊天记录" break save_path = os.path.join(outpath, f"{username}_{i}_{i + page_size}.csv") with open(save_path, "w", encoding="utf-8") as f: diff --git a/pywxdump/cli.py b/pywxdump/cli.py index d2e35cf..a6c978d 100644 --- a/pywxdump/cli.py +++ b/pywxdump/cli.py @@ -287,11 +287,9 @@ class MainExportChatRecords(): sb_decrypt.add_argument("-media", "--media_path", type=str, help="解密后的 MediaMSG.db 的路径", required=True, metavar="") sb_decrypt.add_argument("-fs", "--filestorage_path", type=str, - help="(可选)文件夹FileStorage的路径(用于显示图片)", required=False, - metavar="") + help="(可选)文件夹FileStorage的路径(用于显示图片)", required=False, metavar="") sb_decrypt.add_argument("-t", "--type", type=str, help="导出类型(可选:html,csv)", required=False, - default="html", - metavar="") + default="html", metavar="") return sb_decrypt def run(self, args):