diff --git a/README.md b/README.md index 09a46e5..e5a2652 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ docker run \ ### 参数说明 * 端口 5905: VNC 服务的端口(无法/无需修改) +* network host: 使用宿主机网络(在 Linux Docker 环境下使用) * 环境变量 VNCPASS: 连接 VNC 的密码(可自定义,建议在服务器上使用本镜像的话设置得难一点) * 目录映射 `WeChat Files`: 微信收到的图片/文件存储的目录(可以取消目录映射) * 目录映射 `Application Data`: 微信数据目录(可以取消目录映射) @@ -28,9 +29,11 @@ docker run \ ## 如何使用 1. 运行上方命令启动镜像(更推荐使用 [docker-compose](./docker-compose.yaml) ) 2. 连接上 VNC 扫码登陆微信(建议扫码登陆后把微信的版本号弹窗等关闭) -3. 使用 python 与微信通信(参考文件 [test.py](./test.py) ) +3. 使用 python 与微信通信(示例文件 [test.py](./test.py) ) ## 鸣谢 [ljc545w/ComWeChatRobot](https://github.com/ljc545w/ComWeChatRobot) + [@0honus0](https://github.com/0honus0) + diff --git a/test.py b/test.py index cf8ee76..082933a 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,6 @@ # by @0honus0 +from ensurepip import version import json import copy import threading @@ -320,6 +321,13 @@ if __name__ == '__main__': # start_listen(pids[0],port) #post_wechat_http_api(APIS.WECHAT_LOG_START_HOOK,port) print(post_wechat_http_api(APIS.WECHAT_GET_SELF_INFO, port)) + + # 获取最新版本微信版本号 @tom-snow + # https://api.github.com/repos/tom-snow/wechat-windows-versions/releases?per_page=1 # json 读 [0]["tag_name"] + resp = requests.get(url = "https://api.github.com/repos/tom-snow/wechat-windows-versions/releases?per_page=1",params = {"per_page": 1}) + latest_version = resp.json()[0]["tag_name"] + print(post_wechat_http_api(APIS.WECHAT_SET_VERSION, port, {"version": latest_version})) # 修改成最新版本,防止更新 + print(post_wechat_http_api(APIS.WECHAT_MSG_START_HOOK, port, {"port":10808})) start_socket_server() # stop_listen(pids[0])