From eb62def6638b6839ecfa0c9ded1960b18939838c Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Tue, 9 Jan 2024 20:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/cli.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pywxdump/cli.py b/pywxdump/cli.py index 760ca9e..d2e35cf 100644 --- a/pywxdump/cli.py +++ b/pywxdump/cli.py @@ -289,7 +289,7 @@ class MainExportChatRecords(): sb_decrypt.add_argument("-fs", "--filestorage_path", type=str, help="(可选)文件夹FileStorage的路径(用于显示图片)", required=False, metavar="") - sb_decrypt.add_argument("-t", "--type", type=str, help="导出类型(可选:html,txt)", required=False, + sb_decrypt.add_argument("-t", "--type", type=str, help="导出类型(可选:html,csv)", required=False, default="html", metavar="") return sb_decrypt @@ -297,16 +297,22 @@ class MainExportChatRecords(): def run(self, args): # 从命令行参数获取值 t = args.type - if t not in ["html", "txt"]: + if t not in ["html", "csv"]: print("[-] 未知的导出类型") return if t == "txt": try: - export_csv(args.username, args.outpath, args.msg_path, page_size=1000000) + code, ret = export_csv(args.username, args.outpath, args.msg_path, page_size=1000000) + if not code: + print(ret) + return + print(f"[+] {ret}") + return except Exception as e: print(e) print("[-] 导出失败") return + try: from flask import Flask, request, jsonify, render_template, g import logging