mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-13 23:16:47 +00:00
fix #642
This commit is contained in:
@@ -491,11 +491,14 @@
|
||||
"name": "Bark消息推送",
|
||||
"description": "支持使用Bark发送消息通知。",
|
||||
"labels": "消息通知",
|
||||
"version": "1.1",
|
||||
"version": "1.2",
|
||||
"icon": "Bark_A.png",
|
||||
"author": "jxxghp",
|
||||
"level": 1,
|
||||
"v2": true
|
||||
"v2": true,
|
||||
"history": {
|
||||
"v1.2": "支持多人消息发送"
|
||||
}
|
||||
},
|
||||
"PushDeerMsg": {
|
||||
"name": "PushDeer消息推送",
|
||||
|
||||
@@ -16,7 +16,7 @@ class BarkMsg(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "Bark_A.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.1"
|
||||
plugin_version = "1.2"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -139,7 +139,7 @@ class BarkMsg(_PluginBase):
|
||||
'props': {
|
||||
'model': 'apikey',
|
||||
'label': '密钥',
|
||||
'placeholder': '',
|
||||
'placeholder': '每行一个用户密钥',
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -217,7 +217,7 @@ class BarkMsg(_PluginBase):
|
||||
try:
|
||||
if not self._server or not self._apikey:
|
||||
return False, "参数未配置"
|
||||
for apikey in self._apikey.split()
|
||||
for apikey in self._apikey.split():
|
||||
sc_url = "%s/%s/%s/%s" % (self._server, apikey, quote_plus(title), quote_plus(text))
|
||||
if self._params:
|
||||
sc_url = "%s?%s" % (sc_url, self._params)
|
||||
@@ -227,13 +227,13 @@ class BarkMsg(_PluginBase):
|
||||
code = ret_json['code']
|
||||
message = ret_json['message']
|
||||
if code == 200:
|
||||
logger.info("Bark消息发送成功")
|
||||
logger.info(f"{apikey} Bark消息发送成功")
|
||||
else:
|
||||
logger.warn(f"Bark消息发送失败:{message}")
|
||||
logger.warn(f"{apikey} Bark消息发送失败:{message}")
|
||||
elif res is not None:
|
||||
logger.warn(f"Bark消息发送失败,错误码:{res.status_code},错误原因:{res.reason}")
|
||||
logger.warn(f"{apikey} Bark消息发送失败,错误码:{res.status_code},错误原因:{res.reason}")
|
||||
else:
|
||||
logger.warn(f"Bark消息发送失败:未获取到返回信息")
|
||||
logger.warn(f"{apikey} Bark消息发送失败:未获取到返回信息")
|
||||
except Exception as msg_e:
|
||||
logger.error(f"Bark消息发送失败:{str(msg_e)}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user