fix commands

This commit is contained in:
jxxghp
2023-06-17 20:46:34 +08:00
parent 4ddaa020de
commit e9d2ebca89
9 changed files with 179 additions and 62 deletions

View File

@ -1,5 +1,5 @@
import base64
from typing import Tuple, Optional
from typing import Tuple, Optional, Union
from urllib.parse import urljoin
from lxml import etree
@ -30,6 +30,18 @@ class CookieCloudChain(ChainBase):
password=settings.COOKIECLOUD_PASSWORD
)
def remote_sync(self, userid: Union[int, str]):
"""
远程触发同步站点,发送消息
"""
self.post_message(title="开始同步CookieCloud站点 ...", userid=userid)
# 开始同步
success, msg = self.process()
if success:
self.post_message(title=f"同步站点成功,{msg}", userid=userid)
else:
self.post_message(title=f"同步站点失败:{msg}", userid=userid)
def process(self) -> Tuple[bool, str]:
"""
通过CookieCloud同步站点Cookie