修复部分聊天记录重复的问题#48 #36

This commit is contained in:
shuaikangzhou
2023-12-04 18:56:26 +08:00
parent 7b3774cea9
commit db417dc48f
2 changed files with 10 additions and 8 deletions

View File

@@ -14,13 +14,15 @@ root_path = 'FileStorage/MsgAttach/'
@log
def get_md5_from_xml(content):
# 解析XML
root = ET.fromstring(content)
# 提取md5的值
md5_value = root.find(".//img").get("md5")
# print(md5_value)
return md5_value
try:
# 解析XML
root = ET.fromstring(content)
# 提取md5的值
md5_value = root.find(".//img").get("md5")
# print(md5_value)
return md5_value
except ET.ParseError:
return None
def singleton(cls):
_instance = {}