From 192a0b6a65a900c3b5a9d3002075c8ff6a105015 Mon Sep 17 00:00:00 2001 From: thsrite Date: Mon, 8 Apr 2024 11:19:38 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=B8=B0=E5=AF=8C=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- docs/WeChatForward.md | 1 + package.json | 2 +- plugins/wechatforward/__init__.py | 13 +++++++------ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b6b2a29..5025b89 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ MoviePilot三方插件市场:https://github.com/thsrite/MoviePilot-Plugins/ - [短剧刮削 3.1](docs%2FShortPlayMonitor.md) - [云盘实时链接 1.5](docs%2FCloudLinkMonitor.md) - [源文件恢复 1.2](docs%2FLinkToSrc.md) -- [微信消息转发 1.3](docs%2FWeChatForward.md) +- [微信消息转发 1.5](docs%2FWeChatForward.md) - [订阅下载统计 1.5](docs%2FSubscribeStatistic.md) - [自定义命令 1.2](docs%2FCustomCommand.md) diff --git a/docs/WeChatForward.md b/docs/WeChatForward.md index b9c79ca..042aab3 100644 --- a/docs/WeChatForward.md +++ b/docs/WeChatForward.md @@ -2,6 +2,7 @@ ### 更新记录 +- 1.5 丰富日志 - 1.4 特定消息强制指定userid - 1.3 防重复发送额外消息 - 1.2 fix规则 diff --git a/package.json b/package.json index 5583579..c9bc78d 100644 --- a/package.json +++ b/package.json @@ -138,7 +138,7 @@ "WeChatForward": { "name": "微信消息转发", "description": "根据正则转发通知到其他WeChat应用。", - "version": "1.4", + "version": "1.5", "icon": "Wechat_A.png", "author": "thsrite", "level": 1 diff --git a/plugins/wechatforward/__init__.py b/plugins/wechatforward/__init__.py index 8c58a4d..5fc9e13 100644 --- a/plugins/wechatforward/__init__.py +++ b/plugins/wechatforward/__init__.py @@ -22,7 +22,7 @@ class WeChatForward(_PluginBase): # 插件图标 plugin_icon = "Wechat_A.png" # 插件版本 - plugin_version = "1.4" + plugin_version = "1.5" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -289,6 +289,7 @@ class WeChatForward(_PluginBase): continue if re.search(specify[0], title) and re.search(specify[0], text): userid = specify[2] + logger.info(f"消息 {title} {text} 指定用户 {userid}") break # 发送消息 @@ -560,13 +561,13 @@ class WeChatForward(_PluginBase): if res and res.status_code == 200: ret_json = res.json() if ret_json.get('errcode') == 0: - logger.info(f"转发消息 {title} 成功") + logger.info(f"转发消息 {title} {req_json} 成功") return True else: if ret_json.get('errcode') == 81013: return False - logger.error(f"转发消息 {title} 失败,错误信息:{ret_json}") + logger.error(f"转发消息 {title} {req_json} 失败,错误信息:{ret_json}") if ret_json.get('errcode') == 42001 or ret_json.get('errcode') == 40014: logger.info("token已过期,正在重新刷新token重试") # 重新获取token @@ -583,13 +584,13 @@ class WeChatForward(_PluginBase): retry=retry) return False elif res is not None: - logger.error(f"转发消息 {title} 失败,错误码:{res.status_code},错误原因:{res.reason}") + logger.error(f"转发消息 {title} {req_json} 失败,错误码:{res.status_code},错误原因:{res.reason}") return False else: - logger.error(f"转发消息 {title} 失败,未获取到返回信息") + logger.error(f"转发消息 {title} {req_json} 失败,未获取到返回信息") return False except Exception as err: - logger.error(f"转发消息 {title} 异常,错误信息:{str(err)}") + logger.error(f"转发消息 {title} {req_json} 异常,错误信息:{str(err)}") return False def __get_access_token(self, corpid: str, appsecret: str):