From 03bf9415ac7b27f4e6bab1129da61bdcea11b75b Mon Sep 17 00:00:00 2001 From: Ching Date: Sun, 17 Sep 2023 22:20:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(notify.py):=20http=20=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8D=E4=B8=BA=20200=20=E6=97=B6=E5=8F=91=E9=80=81=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http 状态不为 200 时发送通知 Signed-off-by: Ching --- notify.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/notify.py b/notify.py index 04c2e98..1dee327 100644 --- a/notify.py +++ b/notify.py @@ -54,6 +54,14 @@ except requests.exceptions.RequestException: if not response.status_code == 200: print('HTTP Request failed, status code: ', response.status_code) + # 发送 bark 通知 + requests.post( + url="http://bark.tunpok.com/UZ6zC82bKRjQaXiVkosVWh", + params={ + "title": "chd 通知: HTTP " + response.status_code, + 'group': 'pt-msg', + }, + ) exit(1) soup = bs4.BeautifulSoup(response.text, 'html.parser')