From 046cf302b2bf4b9a700709f885afc38fb0bfb208 Mon Sep 17 00:00:00 2001 From: Womsxd <45663319+Womsxd@users.noreply.github.com> Date: Fri, 22 Oct 2021 22:22:14 +0800 Subject: [PATCH] =?UTF-8?q?sever=E9=85=B1=20=E7=AE=80=E6=98=93=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- push_main-server.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 push_main-server.py diff --git a/push_main-server.py b/push_main-server.py new file mode 100644 index 0000000..f05b5ad --- /dev/null +++ b/push_main-server.py @@ -0,0 +1,38 @@ +import sys +import time +import random +import subprocess +from request import http + +SendKey = "" +send_Url = f"https://sctapi.ftqq.com/{SendKey}.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 = { + "title":"米游社脚本执行出错!", + "desp": "这里是运行相关日志:\r\n" +opt_info + } + ) +else: + http.post( + url = send_Url, + data = { + "title":"米游社脚本执行成功", + "desp": "这里是运行相关日志:\r\n" + opt_info + } + ) + print("OK!") +exit(0)