From a690086dc282d507c438ea3d386e1bd6bf110748 Mon Sep 17 00:00:00 2001 From: STDquantum <405720329@qq.com> Date: Sun, 10 Dec 2023 12:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=A7=86=E9=A2=91=E5=92=8C?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E6=97=B6=E6=B2=A1=E6=9C=89=E5=8E=9F=E5=9B=BE?= =?UTF-8?q?=EF=BC=88=E5=8E=9F=E8=A7=86=E9=A2=91=EF=BC=89=E5=B0=B1=E6=94=BE?= =?UTF-8?q?=E7=BC=A9=E7=95=A5=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/output_pc.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/DataBase/output_pc.py b/app/DataBase/output_pc.py index 806d315..1ca25f4 100644 --- a/app/DataBase/output_pc.py +++ b/app/DataBase/output_pc.py @@ -659,6 +659,11 @@ const chatMessages = [ ) elif type_ == 3: image_path = hard_link_db.get_image(str_content, BytesExtra, thumb=False) + image_thumb_path = hard_link_db.get_image(str_content, BytesExtra, thumb=True) + if image_path is None and image_thumb_path is not None: + image_path = image_thumb_path + if image_path is None and image_thumb_path is None: + continue image_path = path.get_relative_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image') image_path = image_path.replace('\\', '/') # print(f"tohtml:---{image_path}") @@ -671,6 +676,23 @@ const chatMessages = [ ) elif type_ == 43: 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.replace('\\', '/') + # print(f"tohtml:---{image_path}") + if self.is_5_min(timestamp): + f.write( + f'''{{ type:0, text: '{str_time}',is_send:0,avatar_path:''}},''' + ) + f.write( + f'''{{ type:3, text: '{image_path}',is_send:{is_send},avatar_path:'{avatar}'}},''' + ) + continue + if video_path is None and image_path is None: + continue video_path = f'{MePC().wx_dir}/{video_path}' if os.path.exists(video_path): new_path = origin_docx_path + '/video/' + os.path.basename(video_path)