From c71ef4ef628f9aff2166d170cc793719707cc44b Mon Sep 17 00:00:00 2001 From: H Vs Date: Fri, 25 Apr 2025 14:52:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BE=A4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/endpoints/pipeline_endpoint.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/app/endpoints/pipeline_endpoint.py b/app/endpoints/pipeline_endpoint.py index e59b22a..ce71e9f 100644 --- a/app/endpoints/pipeline_endpoint.py +++ b/app/endpoints/pipeline_endpoint.py @@ -891,15 +891,21 @@ async def handle_image_group_async(request: Request,token_id,app_id, wxid,msg_da msg_content=msg_data["Content"]["string"] callback_to_user=msg_data["FromUserName"]["string"] - aeskey = re.search(r'aeskey="([^"]+)"', msg_content).group(1) - cdnthumburl = re.search(r'cdnthumburl="([^"]+)"', msg_content).group(1) - md5 = re.search(r'md5="([^"]+)"', msg_content).group(1) - cdnthumblength = re.search(r'cdnthumblength="([^"]+)"', msg_content).group(1) - cdnthumbheight = re.search(r'cdnthumbheight="([^"]+)"', msg_content).group(1) - cdnthumbwidth = re.search(r'cdnthumbwidth="([^"]+)"', msg_content).group(1) - length = re.search(r'length="([^"]+)"', msg_content).group(1) - - img_xml=f'\n\n\t\n\t\n\t\n' + # aeskey = re.search(r'aeskey="([^"]+)"', msg_content).group(1) + # cdnthumburl = re.search(r'cdnthumburl="([^"]+)"', msg_content).group(1) + # md5 = re.search(r'md5="([^"]+)"', msg_content).group(1) + # cdnthumblength = re.search(r'cdnthumblength="([^"]+)"', msg_content).group(1) + # cdnthumbheight = re.search(r'cdnthumbheight="([^"]+)"', msg_content).group(1) + # cdnthumbwidth = re.search(r'cdnthumbwidth="([^"]+)"', msg_content).group(1) + # length = re.search(r'length="([^"]+)"', msg_content).group(1) + + # img_xml=f'\n\n\t\n\t\n\t\n' + xml_match = re.search(r'<\?xml.*', msg_content, re.DOTALL) + if not xml_match: + logger.info(f'找不到图片地址') + return + img_xml=xml_match.group(0) + wx_img_url= await request.app.state.gewe_service.download_image_msg_async(token_id,app_id,img_xml) if not wx_img_url: logger.warning(f'{wxid} 下载 {callback_to_user} 图片失败')