fix 丰富日志

This commit is contained in:
thsrite
2024-04-08 11:19:38 +08:00
parent c12cd5779b
commit 192a0b6a65
4 changed files with 10 additions and 8 deletions

View File

@@ -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)

View File

@@ -2,6 +2,7 @@
### 更新记录
- 1.5 丰富日志
- 1.4 特定消息强制指定userid
- 1.3 防重复发送额外消息
- 1.2 fix规则

View File

@@ -138,7 +138,7 @@
"WeChatForward": {
"name": "微信消息转发",
"description": "根据正则转发通知到其他WeChat应用。",
"version": "1.4",
"version": "1.5",
"icon": "Wechat_A.png",
"author": "thsrite",
"level": 1

View File

@@ -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):