feat(notify.py): http 状态不为 200 时发送通知
http 状态不为 200 时发送通知 Signed-off-by: Ching <loooching@gmail.com>
This commit is contained in:
parent
49d55db29a
commit
03bf9415ac
@ -54,6 +54,14 @@ except requests.exceptions.RequestException:
|
|||||||
|
|
||||||
if not response.status_code == 200:
|
if not response.status_code == 200:
|
||||||
print('HTTP Request failed, status code: ', response.status_code)
|
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)
|
exit(1)
|
||||||
|
|
||||||
soup = bs4.BeautifulSoup(response.text, 'html.parser')
|
soup = bs4.BeautifulSoup(response.text, 'html.parser')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user