Compare commits
No commits in common. "056c5528e52cfdb60604b398a3ba2d063807c8f1" and "6555190a4d43e5245d58dec9e81424908f3a9296" have entirely different histories.
056c5528e5
...
6555190a4d
|
|
@ -15,9 +15,6 @@ notifications:
|
||||||
telegram:
|
telegram:
|
||||||
bot_token: "6689586847:AAH0lg1uuXiZMsou9WNYif7qqrbCSdZWWj0"
|
bot_token: "6689586847:AAH0lg1uuXiZMsou9WNYif7qqrbCSdZWWj0"
|
||||||
chat_id: "1762053255"
|
chat_id: "1762053255"
|
||||||
# PushPlus推送加,https://www.pushplus.plus/
|
|
||||||
pushplus:
|
|
||||||
key: ""
|
|
||||||
|
|
||||||
######## 以下为账号配置项,可以多账号,详情请参考文档 ########
|
######## 以下为账号配置项,可以多账号,详情请参考文档 ########
|
||||||
accounts:
|
accounts:
|
||||||
|
|
|
||||||
25
main.py
25
main.py
|
|
@ -153,31 +153,6 @@ def send_notifications(message: str, settings: dict, proxy: str = None):
|
||||||
else:
|
else:
|
||||||
logger.debug("DingTalk not configured.")
|
logger.debug("DingTalk not configured.")
|
||||||
|
|
||||||
# PushPlus
|
|
||||||
sct_conf = settings.get("pushplus", {})
|
|
||||||
sct_key = sct_conf.get("key")
|
|
||||||
if sct_key:
|
|
||||||
sct_url = f"http://www.pushplus.plus/send/{sct_key}"
|
|
||||||
try:
|
|
||||||
payload = {"title": "MHYY-AutoCheckin 状态推送", "content": message}
|
|
||||||
response = httpx.post(sct_url, data=payload, timeout=10)
|
|
||||||
response.raise_for_status()
|
|
||||||
logger.info("PushPlus notification sent successfully.")
|
|
||||||
except httpx.HTTPStatusError as e:
|
|
||||||
logger.error(
|
|
||||||
f"PushPlus HTTP error occurred: {e.response.status_code} - {e.response.text}"
|
|
||||||
)
|
|
||||||
except httpx.RequestError as e:
|
|
||||||
logger.error(f"An error occurred while requesting PushPlus: {e}")
|
|
||||||
except Exception as e:
|
|
||||||
logger.error(
|
|
||||||
f"An unexpected error occurred sending PushPlus notification: {e}"
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
logger.debug("PushPlus not configured.")
|
|
||||||
|
|
||||||
|
|
||||||
# Telegram
|
|
||||||
telegram_conf = settings.get("telegram", {})
|
telegram_conf = settings.get("telegram", {})
|
||||||
telegram_bot_token = telegram_conf.get("bot_token")
|
telegram_bot_token = telegram_conf.get("bot_token")
|
||||||
telegram_chat_id = telegram_conf.get("chat_id")
|
telegram_chat_id = telegram_conf.get("chat_id")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user