MihoyoBBSTools/push_main-pushplus.py

41 lines
1.0 KiB
Python
Raw Normal View History

2021-12-26 15:23:35 +00:00
import sys
import time
import random
import subprocess
from request import http
SendKey = ""
send_Url = "http://www.pushplus.plus/send"
python_Path = sys.executable
run_ShellCommand = python_Path + " main_multi.py autorun"
for i in range(2):
opt_id, opt_info = subprocess.getstatusoutput(run_ShellCommand)
if opt_id == 0:
break
time.sleep(random.randint(30, 70))
if opt_id != 0:
print("Error!")
http.post(
url=send_Url,
data={
"token": SendKey,
2022-01-09 01:35:24 +00:00
"title": "「米游社-签到」Error!",
2022-01-11 07:54:47 +00:00
"content": opt_info.split()[-1] + "\nHello!推送相关的设置已修改,请注意更新!\n这里是运行相关日志:\r\n" + opt_info,
2021-12-26 15:23:35 +00:00
}
)
else:
2022-01-09 01:35:24 +00:00
print("OK!")
2021-12-26 15:23:35 +00:00
http.post(
url=send_Url,
data={
"token": SendKey,
2022-01-09 01:35:24 +00:00
"title": "「米游社-签到」OK!",
2022-01-11 07:54:47 +00:00
"content": opt_info.split()[-1] + "\nHello!推送相关的设置已修改,请注意更新!\n这里是运行相关日志:\r\n" + opt_info,
2021-12-26 15:23:35 +00:00
}
)
exit(0)