From c361de5ad582966159e6976ce55a6ae6b0b30837 Mon Sep 17 00:00:00 2001 From: STDquantum <405720329@qq.com> Date: Wed, 13 Dec 2023 21:03:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=8A=E8=A7=86=E9=A2=91=E3=80=81?= =?UTF-8?q?=E9=9F=B3=E9=A2=91=E5=92=8C=E5=9B=BE=E7=89=87=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=E2=80=9D=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=85=B6=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=8C=E6=96=B9=E4=BE=BF=E5=9C=A8=E6=9C=AC=E5=9C=B0=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E8=A7=82=E5=AF=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/output_pc.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index 3966dac..24de94f 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -190,6 +190,7 @@ class ChildThread(QThread): ) def image(self, doc, message): + origin_docx_path = f"{os.path.abspath('.')}/data/聊天记录/{self.contact.remark}" type_ = message[2] str_content = message[7] str_time = message[8] @@ -210,6 +211,9 @@ class ChildThread(QThread): if image_path is None and image_thumb_path is None: return 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('\\', '/') # print(f"tohtml:---{image_path}") if self.is_5_min(timestamp): @@ -236,6 +240,8 @@ class ChildThread(QThread): if self.output_type == Output.HTML: try: 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('\\', '/') voice_to_text = media_msg_db.get_audio_text(str_content) except: @@ -345,9 +351,10 @@ class ChildThread(QThread): video_path = hard_link_db.get_video(str_content, BytesExtra, thumb=False) image_path = hard_link_db.get_video(str_content, BytesExtra, thumb=True) 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') - 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('\\', '/') # print(f"tohtml:---{image_path}") if self.is_5_min(timestamp): @@ -365,6 +372,7 @@ class ChildThread(QThread): new_path = origin_docx_path + '/video/' + os.path.basename(video_path) if not os.path.exists(new_path): 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 = video_path.replace('\\', '/') if self.is_5_min(timestamp): From 6e79988429850963e6f0c305472094380dfcc396 Mon Sep 17 00:00:00 2001 From: STDquantum <405720329@qq.com> Date: Thu, 14 Dec 2023 17:43:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3/doge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- readme.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 8069448..43e85f0 100644 --- a/readme.md +++ b/readme.md @@ -44,7 +44,7 @@ - 拍一拍等系统消息✅ - 导出聊天记录 - sqlite数据库✅ - - HTML(文本、图片、视频、表情包)✅ + - HTML(文本、图片、视频、表情包、语音)✅ - CSV文档✅ - TXT文档✅ - Word文档❎ @@ -52,7 +52,6 @@ - 🔥**项目持续更新中** - 导出全部表情包❎ - 合并多个备份数据❎ - - 语音❎ - 文件❎ - 小伙伴们想要其他功能可以留言哦📬