pushplus推送脚本

This commit is contained in:
Womsxd 2021-12-26 23:23:35 +08:00
parent 92be7f4a9d
commit ce3882e4df
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68

40
push_main-pushplus.py Normal file
View File

@ -0,0 +1,40 @@
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,
"title": "米游社脚本执行出错!",
"desp": "这里是运行相关日志:\r\n" + opt_info
}
)
else:
http.post(
url=send_Url,
data={
"token": SendKey,
"title": "米游社脚本执行成功",
"desp": "这里是运行相关日志:\r\n" + opt_info
}
)
print("OK!")
exit(0)