feat(notify.py): http 状态不为 200 时发送通知

http 状态不为 200 时发送通知

Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
Ching 2023-09-17 22:20:30 +08:00
parent 49d55db29a
commit 03bf9415ac

View File

@ -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')