Skip to content

Commit

Permalink
合并转发的聊天记录 #84
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoyaoo committed Mar 12, 2024
1 parent 6296257 commit bf8e008
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pywxdump/analyzer/export_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,17 @@ def get_msg_list(MSG_db_path, selected_talker="", start_index=0, page_size=500):
file_name = os.path.basename(url)
content["msg"] = file_name

elif type_id == (19, 2000): # 转账消息
elif type_id == (49, 19): # 合并转发的聊天记录
CompressContent = decompress_CompressContent(CompressContent)
content_tmp = parse_xml_string(CompressContent)
title = content_tmp.get("appmsg", {}).get("title", "")
des = content_tmp.get("appmsg", {}).get("des", "")
recorditem = content_tmp.get("appmsg", {}).get("recorditem", "")
recorditem = parse_xml_string(recorditem)
content["msg"] = f"{title}\n{des}"
content["src"] = recorditem

elif type_id == (49, 2000): # 转账消息
CompressContent = decompress_CompressContent(CompressContent)
content_tmp = parse_xml_string(CompressContent)
feedesc = content_tmp.get("appmsg", {}).get("wcpayinfo", {}).get("feedesc", "")
Expand Down Expand Up @@ -296,6 +306,7 @@ def get_chat_count(MSG_db_path: [str, list], username: str = ""):
chat_counts[username] = chat_count
return chat_counts


def get_all_chat_count(MSG_db_path: [str, list]):
"""
获取聊天记录总数量
Expand Down

0 comments on commit bf8e008

Please sign in to comment.