mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-23 03:22:17 +08:00
Merge pull request #130 from STDquantum/master
把视频、音频和图片的“修改时间”属性改为其发送时间,方便在本地筛选观察
This commit is contained in:
commit
f9748f25d1
@ -190,6 +190,7 @@ class ChildThread(QThread):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def image(self, doc, message):
|
def image(self, doc, message):
|
||||||
|
origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}"
|
||||||
type_ = message[2]
|
type_ = message[2]
|
||||||
str_content = message[7]
|
str_content = message[7]
|
||||||
str_time = message[8]
|
str_time = message[8]
|
||||||
@ -210,6 +211,9 @@ class ChildThread(QThread):
|
|||||||
if image_path is None and image_thumb_path is None:
|
if image_path is None and image_thumb_path is None:
|
||||||
return
|
return
|
||||||
image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image')
|
image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image')
|
||||||
|
image_path = image_path.replace('/', '\\')
|
||||||
|
os.utime(origin_docx_path + image_path[1:], (timestamp, timestamp))
|
||||||
|
print(origin_docx_path + image_path[1:])
|
||||||
image_path = image_path.replace('\\', '/')
|
image_path = image_path.replace('\\', '/')
|
||||||
# print(f"tohtml:---{image_path}")
|
# print(f"tohtml:---{image_path}")
|
||||||
if self.is_5_min(timestamp):
|
if self.is_5_min(timestamp):
|
||||||
@ -236,6 +240,8 @@ class ChildThread(QThread):
|
|||||||
if self.output_type == Output.HTML:
|
if self.output_type == Output.HTML:
|
||||||
try:
|
try:
|
||||||
audio_path = media_msg_db.get_audio(msgSvrId, output_path=origin_docx_path + "/voice")
|
audio_path = media_msg_db.get_audio(msgSvrId, output_path=origin_docx_path + "/voice")
|
||||||
|
audio_path = audio_path.replace('/', '\\')
|
||||||
|
os.utime(audio_path, (timestamp, timestamp))
|
||||||
audio_path = audio_path.replace('\\', '/')
|
audio_path = audio_path.replace('\\', '/')
|
||||||
voice_to_text = media_msg_db.get_audio_text(str_content)
|
voice_to_text = media_msg_db.get_audio_text(str_content)
|
||||||
except:
|
except:
|
||||||
@ -356,9 +362,10 @@ class ChildThread(QThread):
|
|||||||
video_path = hard_link_db.get_video(str_content, BytesExtra, thumb=False)
|
video_path = hard_link_db.get_video(str_content, BytesExtra, thumb=False)
|
||||||
image_path = hard_link_db.get_video(str_content, BytesExtra, thumb=True)
|
image_path = hard_link_db.get_video(str_content, BytesExtra, thumb=True)
|
||||||
if video_path is None and image_path is not None:
|
if video_path is None and image_path is not None:
|
||||||
print(video_path, image_path)
|
|
||||||
image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image')
|
image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image')
|
||||||
print(image_path)
|
image_path = image_path
|
||||||
|
os.utime(origin_docx_path + image_path[1:], (timestamp, timestamp))
|
||||||
|
print(origin_docx_path + image_path[1:])
|
||||||
image_path = image_path.replace('\\', '/')
|
image_path = image_path.replace('\\', '/')
|
||||||
# print(f"tohtml:---{image_path}")
|
# print(f"tohtml:---{image_path}")
|
||||||
if self.is_5_min(timestamp):
|
if self.is_5_min(timestamp):
|
||||||
@ -376,6 +383,7 @@ class ChildThread(QThread):
|
|||||||
new_path = origin_docx_path + '/video/' + os.path.basename(video_path)
|
new_path = origin_docx_path + '/video/' + os.path.basename(video_path)
|
||||||
if not os.path.exists(new_path):
|
if not os.path.exists(new_path):
|
||||||
shutil.copy(video_path, os.path.join(origin_docx_path, 'video'))
|
shutil.copy(video_path, os.path.join(origin_docx_path, 'video'))
|
||||||
|
os.utime(new_path, (timestamp, timestamp))
|
||||||
video_path = f'./video/{os.path.basename(video_path)}'
|
video_path = f'./video/{os.path.basename(video_path)}'
|
||||||
video_path = video_path.replace('\\', '/')
|
video_path = video_path.replace('\\', '/')
|
||||||
if self.is_5_min(timestamp):
|
if self.is_5_min(timestamp):
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
- 拍一拍等系统消息✅
|
- 拍一拍等系统消息✅
|
||||||
- 导出聊天记录
|
- 导出聊天记录
|
||||||
- sqlite数据库✅
|
- sqlite数据库✅
|
||||||
- HTML(文本、图片、视频、表情包)✅
|
- HTML(文本、图片、视频、表情包、语音)✅
|
||||||
- CSV文档✅
|
- CSV文档✅
|
||||||
- TXT文档✅
|
- TXT文档✅
|
||||||
- Word文档❎
|
- Word文档❎
|
||||||
@ -51,7 +51,6 @@
|
|||||||
- 🔥**项目持续更新中**
|
- 🔥**项目持续更新中**
|
||||||
- 导出全部表情包❎
|
- 导出全部表情包❎
|
||||||
- 合并多个备份数据❎
|
- 合并多个备份数据❎
|
||||||
- 语音❎
|
|
||||||
- 文件❎
|
- 文件❎
|
||||||
- 小伙伴们想要其他功能可以留言哦📬
|
- 小伙伴们想要其他功能可以留言哦📬
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user