mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-11 22:50:45 +08:00
✨ 优化 SmartStrm 插件初始化逻辑
This commit is contained in:
parent
0f6b6839c4
commit
473ac0d468
@ -18,8 +18,26 @@ class Smartstrm:
|
||||
else:
|
||||
print(f"{self.plugin_name} 模块缺少必要参数: {key}")
|
||||
if self.webhook and self.strmtask:
|
||||
print(f"SmartStrm 触发任务: {self.strmtask} ")
|
||||
self.is_active = True
|
||||
if self.get_info():
|
||||
self.is_active = True
|
||||
|
||||
def get_info(self):
|
||||
"""获取 SmartStrm 信息"""
|
||||
try:
|
||||
response = requests.request(
|
||||
"GET",
|
||||
self.webhook,
|
||||
timeout=5,
|
||||
)
|
||||
response = response.json()
|
||||
if response.get("success"):
|
||||
print(f"SmartStrm 触发任务: 连接成功 {response.get('version','')}")
|
||||
return response
|
||||
print(f"SmartStrm 触发任务:连接失败 {response.get('message','')}")
|
||||
return None
|
||||
except Exception as e:
|
||||
print(f"SmartStrm 触发任务:连接出错 {str(e)}")
|
||||
return None
|
||||
|
||||
def run(self, task, **kwargs):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user