|
|
@@ -1020,13 +1020,18 @@ async def handle_video_async(request: Request,token_id,app_id, wxid,msg_data,fro |
|
|
|
logger.info('视频消息') |
|
|
|
try: |
|
|
|
msg_content_xml=msg_data["Content"]["string"] |
|
|
|
video_url=await request.app.state.gewe_service.download_video_msg_async(token_id,app_id,msg_content_xml) |
|
|
|
if not video_url: |
|
|
|
logger.warning(f'处理视频消息异常') |
|
|
|
wx_video_url=await request.app.state.gewe_service.download_video_msg_async(token_id,app_id,msg_content_xml) |
|
|
|
if not wx_video_url: |
|
|
|
logger.warning(f'处理微信视频消息异常') |
|
|
|
return |
|
|
|
callback_to_user=from_wxid |
|
|
|
print(video_url) |
|
|
|
wx_content_dialogue_message = [{"type": "file", "file_url": {"url":video_url}}] |
|
|
|
print(wx_video_url) |
|
|
|
|
|
|
|
file_url=url_file_to_oss(wx_video_url) |
|
|
|
if not file_url: |
|
|
|
logger.warning(f'处理微信视频上传到oss异常') |
|
|
|
return |
|
|
|
wx_content_dialogue_message = [{"type": "file", "file_url": {"url":file_url}}] |
|
|
|
k_message = dialogue_message(callback_to_user,wxid, wx_content_dialogue_message) |
|
|
|
await request.app.state.kafka_service.send_message_async(k_message) |
|
|
|
logger.info("发送对话 %s",k_message) |
|
|
|