添加导出为csv命令【测试功能】

This commit is contained in:
xaoyaoo 2023-12-28 09:07:24 +08:00
parent ee2ab5de80
commit bc69400b2c
3 changed files with 16 additions and 0 deletions

View File

@ -9,6 +9,7 @@ from .wx_info import BiasAddr, read_info, get_wechat_db, encrypt, batch_decrypt,
from .wx_info import merge_copy_db, merge_msg_db, merge_media_msg_db, merge_db
from .analyzer.db_parsing import read_img_dat, read_emoji, decompress_CompressContent, read_audio_buf, read_audio, \
parse_xml_string, read_BytesExtra
from .analyzer import export_csv
from .ui import app_show_chat, get_user_list, export
import os, json

View File

@ -6,3 +6,4 @@
# Date: 2023/09/27
# -------------------------------------------------------------------------------
from .db_parsing import read_img_dat, read_emoji, decompress_CompressContent, read_audio_buf, read_audio, parse_xml_string,read_BytesExtra
from .export_chat import export_csv

View File

@ -245,10 +245,24 @@ 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,
default="html",
metavar="")
return sb_decrypt
def run(self, args):
# 从命令行参数获取值
t = args.type
if t not in ["html", "txt"]:
print("[-] 未知的导出类型")
return
if t == "txt":
try:
export_csv(args.username, args.outpath, args.msg_path, page_size=1000000)
except Exception as e:
print(e)
print("[-] 导出失败")
return
try:
from flask import Flask, request, jsonify, render_template, g
import logging