diff --git a/clients/python/README.MD b/clients/python/README.MD index 9e5b875..63a69e2 100644 --- a/clients/python/README.MD +++ b/clients/python/README.MD @@ -58,11 +58,13 @@ def main(): LOG.info(f"send_text: {ret}") sleep(5) - ret = wcf.send_image("TEQuant.jpeg", "filehelper") # 需要确保图片路径正确,建议使用绝对路径(使用双斜杠\\) + # 需要确保图片路径正确,建议使用绝对路径(使用双斜杠\\) + ret = wcf.send_image("https://raw.githubusercontent.com/lich0821/WeChatFerry/master/assets/QR.jpeg", "filehelper") LOG.info(f"send_image: {ret}") sleep(5) - ret = wcf.send_file("README.MD", "filehelper") # 需要确保文件路径正确,建议使用绝对路径(使用双斜杠\\) + # 需要确保文件路径正确,建议使用绝对路径(使用双斜杠\\) + ret = wcf.send_file("https://raw.githubusercontent.com/lich0821/WeChatFerry/master/README.MD", "filehelper") LOG.info(f"send_file: {ret}") sleep(5) @@ -127,11 +129,14 @@ python -m grpc_tools.protoc --python_out=. --proto_path=../../../WeChatFerry/rpc ``` ## 版本更新 +### 39.0.2.1 (2023.08.01) +* 发送文件支持网络路径 + +
点击查看更多 ### 39.0.2.0 (2023.07.16) * 获取朋友圈消息 -
点击查看更多 版本号:`w.x.y.z`。 其中: @@ -152,7 +157,7 @@ python -m grpc_tools.protoc --python_out=. --proto_path=../../../WeChatFerry/rpc * 获取用户信息 * 发送文本消息(可 @) * 发送图片(Python 客户端支持网络路径) -* 发送文件 +* 发送文件(Python 客户端支持网络路径) * 允许接收消息 * 停止接收消息 * 执行 SQL 查询 diff --git a/clients/python/demo.py b/clients/python/demo.py index 3363fe0..25cb909 100644 --- a/clients/python/demo.py +++ b/clients/python/demo.py @@ -43,11 +43,13 @@ def main(): LOG.info(f"send_text: {ret}") sleep(5) - ret = wcf.send_image("TEQuant.jpeg", "filehelper") # 需要确保图片路径正确,建议使用绝对路径(使用双斜杠\\) + # 需要确保图片路径正确,建议使用绝对路径(使用双斜杠\\) + ret = wcf.send_image("https://raw.githubusercontent.com/lich0821/WeChatFerry/master/assets/QR.jpeg", "filehelper") LOG.info(f"send_image: {ret}") sleep(5) - ret = wcf.send_file("README.MD", "filehelper") # 需要确保文件路径正确,建议使用绝对路径(使用双斜杠\\) + # 需要确保文件路径正确,建议使用绝对路径(使用双斜杠\\) + ret = wcf.send_file("https://raw.githubusercontent.com/lich0821/WeChatFerry/master/README.MD", "filehelper") LOG.info(f"send_file: {ret}") sleep(5) diff --git a/clients/python/wcferry/client.py b/clients/python/wcferry/client.py index f5ecf43..ee98b06 100644 --- a/clients/python/wcferry/client.py +++ b/clients/python/wcferry/client.py @@ -1,7 +1,7 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -__version__ = "39.0.2.0" +__version__ = "39.0.2.1" import atexit import base64 @@ -277,8 +277,6 @@ class Wcf(): # 保存文件,用完后删除 with open(f"{self._dl_path}/{fname}", "wb") as of: - if "text" in ct: - of.write(rsp.text) of.write(rsp.content) path = os.path.normpath(f"{self._dl_path}/{fname}")