From e55c9e1ce72e383ad40b3e82dd84430dfb608964 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sun, 9 Oct 2022 14:15:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9=E7=88=B1=E8=AF=AD?= =?UTF-8?q?=E9=A3=9E=E9=A3=9E=E9=80=9A=E7=9F=A5=E7=9A=84=E6=94=AF=E6=8C=81?= =?UTF-8?q?=EF=BC=8C=E8=AF=B7=E4=B8=A5=E6=A0=BC=E6=8C=89=E7=85=A7=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=A1=AB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pt_site/UtilityTool.py | 10 ++++++++++ ptools/base.py | 1 + 2 files changed, 11 insertions(+) diff --git a/pt_site/UtilityTool.py b/pt_site/UtilityTool.py index de63b6e..26fab78 100644 --- a/pt_site/UtilityTool.py +++ b/pt_site/UtilityTool.py @@ -163,6 +163,16 @@ class PtSpider: res = self.get_scraper().get(url=url) msg = 'bark通知' + str(res) logger.info(msg) + + if notify.name == PushConfig.iyuu_push: + url = notify.custom_server + '{}.send'.format(notify.corpsecret) + res = self.get_scraper().post( + url=url, + data={ + 'text': 'PTools消息推送', + 'desp': text + }) + logger.info('爱语飞飞通知:' + res) except Exception as e: logger.info("通知发送失败," + str(e)) diff --git a/ptools/base.py b/ptools/base.py index 77424ba..68fd759 100644 --- a/ptools/base.py +++ b/ptools/base.py @@ -167,6 +167,7 @@ class PushConfig(models.TextChoices): wxpusher_push = 'wxpusher_push', 'WxPusher通知' pushdeer_push = 'pushdeer_push', 'PushDeer通知' bark_push = 'bark_push', 'Bark通知' + iyuu_push = 'iyuu_push', '爱语飞飞' class OCRConfig(models.TextChoices):