From 93d87b51b429f72e99a4fc81da46a37cbb740923 Mon Sep 17 00:00:00 2001 From: Oxi Date: Sun, 9 Oct 2022 11:37:08 +0530 Subject: [PATCH] Added logging and cleaned code --- __pycache__/msg.cpython-310.pyc | Bin 0 -> 5406 bytes nglspam.py | 117 +++++++++++++++++++------------- 2 files changed, 70 insertions(+), 47 deletions(-) create mode 100644 __pycache__/msg.cpython-310.pyc diff --git a/__pycache__/msg.cpython-310.pyc b/__pycache__/msg.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ce6e771505dbd5087babe891793763f9f6e33cee GIT binary patch literal 5406 zcmZ`-&yO5O6ec)4y|2oi zJ9l;iKmT5QJO9_t#>Ri>WA*11e0&%G-6noj8^y+-&wR8|ocUnm@Rh^Q!aWR1;Z)u! zFBUe4scO9_J3FJVPPDR9#yj!+>2E)dn^KztFN_s)xrnbxvk*_@xpSlf)lgwI$S!j#X{sZ7!S|=@o!nYm`fw(N=)dV^IEyMmv=Ja z4=-AsPeUsj4dZYYk8ssH0YVEw2|EcA=1h~ei*5;55c|a7BVab88rI|^4N(-fpR$Y$R!N6;)T6`Da5A9qa+pqRhjm7DajEyc; zCZ5D|{kSu>gB>@A&sNDPykvc?AS_K4WQF-R`uVv;IHtOAe9nM8Xb?XrL%0#`Tv94; z7Zy^DB8QVJjj*jUs)%QcPRW^gY$vc8j_L%m6^=qK;Xs9MTbw70=V@x;Yf4Nz#dj%B zY^TXF)*@aP#_yRu(PZ6^1_2&87XAeFgXlU=sowm10Y1m zi47jMlTi~L_t&Mk{$O=2JCtWjJ9k;wqO;N8*xa?Y^BK7 z?1yvIFS42whZLTw!npOmm>P`F3DLQlbP+FTq&%S+|LpC>vs%o6cdYrMh7v-hgu%4g zSG93o0+zJ#9Ts+;ph`XIKLB6a3GD@dQ)M{XEy` z0_acAL|y|e0eA}-V~Ti*0A7$2VFPWaT-e6y0dS-#utYZvWiyDuE-;ti5K-YyEhZ?G zdA&F~I*K<4LsC;93`c)6(=s&FU}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xG9%wp^8wSY9@uMIA2)Bpeg literal 0 HcmV?d00001 diff --git a/nglspam.py b/nglspam.py index 19d9b36..07dadb3 100644 --- a/nglspam.py +++ b/nglspam.py @@ -1,23 +1,45 @@ -import json -import random -import time +import json, random, time, httpx, sys, os from concurrent.futures import ThreadPoolExecutor +import threading from msg import randomQuestions -try: - import colorama - import httpx -except: - print('Please install colorama by doing pip3 install colorama or pip3 install httpx') - exit() -errored = 0 -sent = 0 +from colorama import Fore, Style +from time import strftime, gmtime + + +sent, errored = 0,0 +class Console: + @staticmethod + def get_time() -> str: + return time.strftime("%H:%M:%S", time.gmtime()) + + @staticmethod + def logger(*content: tuple, status: bool) -> None: + lock = threading.Lock() + time = Console.get_time() + + green = '['+Fore.GREEN + Style.BRIGHT + '+' + Style.RESET_ALL + '] ' + red = '['+Fore.RED + Style.BRIGHT + '-' + Style.RESET_ALL + '] ' + yellow = '['+Fore.YELLOW + Style.BRIGHT + '!' + Style.RESET_ALL + '] ' + with lock: + if status == 'g': + sys.stdout.write( + f'{Fore.YELLOW}[{time}]{Style.RESET_ALL}{green}{" ".join(content)}\n') + elif status == 'r': + sys.stdout.write( + f'{Fore.YELLOW}[{time}]{Style.RESET_ALL}{red}{" ".join(content)}\n') + elif status == 'y': + sys.stdout.write( + f'{Fore.YELLOW}[{time}]{Style.RESET_ALL}{yellow}{" ".join(content)}\n') + + @staticmethod + def clear() -> None: + os.system('cls' if os.name == 'nt' else 'clear') + def main(username, message, deviceid, proxy, proxystatus): global errored global sent - green = '['+colorama.Fore.GREEN + colorama.Style.BRIGHT + '+' + colorama.Style.RESET_ALL + '] ' - red = '['+colorama.Fore.RED + colorama.Style.BRIGHT + '-' + colorama.Style.RESET_ALL + '] ' - yellow = '['+colorama.Fore.YELLOW + colorama.Style.BRIGHT + '!' + colorama.Style.RESET_ALL + '] ' + headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Accept-Language':'en-US,en;q=0.5', 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', 'User-Agent':'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0'} with httpx.Client(headers=headers) as client: @@ -32,55 +54,56 @@ def main(username, message, deviceid, proxy, proxystatus): postresp = client.post(f"https://ngl.link/{username}", data={'question': message + 'TROLLEDLOL ' + message, 'deviceId':deviceid}) if postresp.status_code == 302: sent += 1 - print(green + f"Sent {message} to victim, Sent {sent} messages, Errored {errored} messages") + Console.logger(f"Sent {message} to victim, Sent {sent} messages, Errored {errored} messages", status='g') elif postresp.status_code == 404: - print(red + f"User {username} does not exist") + Console.logger(f"User {username} does not exist", status='r') exit() elif postresp.status_code == 429: - print(red + f"User {username} is rate limited") + Console.logger(f"User {username} is rate limited", status='r') except Exception as e: errored+=1 - print(yellow + f'Error: {e}') + Console.logger(f'Error: {e}', status='y') main(username, messages(), deviceid(), proxy()) + + def messages(): return random.choice(randomQuestions) + def proxy(): return 'http://' + random.choice(list(open('proxy.txt'))) + def deviceid(): return ''.join(random.choice('0123456789abcdefghijklmnopqrstuvwxyz-') for i in range(36)) -question = '[' + colorama.Fore.YELLOW + '?' + colorama.Back.YELLOW + colorama.Style.BRIGHT + colorama.Style.RESET_ALL + '] ' -info = question = '[' + colorama.Fore.YELLOW + '!' + colorama.Back.YELLOW + colorama.Style.BRIGHT + colorama.Style.RESET_ALL + '] ' -print(colorama.Fore.LIGHTRED_EX + ''' -▒█▄░▒█ ▒█▀▀█ ▒█░░░   ▒█▀▀▀█ ▒█▀▀█ ░█▀▀█ ▒█▀▄▀█ -▒█▒█▒█ ▒█░▄▄ ▒█░░░   ░▀▀▀▄▄ ▒█▄▄█ ▒█▄▄█ ▒█▒█▒█ -▒█░░▀█ ▒█▄▄█ ▒█▄▄█   ▒█▄▄▄█ ▒█░░░ ▒█░▒█ ▒█░░▒█ -''' + colorama.Fore.GREEN + 'Made by https://github.com/oxitheman' + '\nStar the repository on github if you like it!' + colorama.Style.RESET_ALL) - -print(colorama.Fore.GREEN + colorama.Style.RESET_ALL) -print(info + 'If you would like to send random questions or use proxies edit config.json to true.') -username = str(input( question +"Enter username: ")) -threadcount = int(input(question+"Enter thread count: ")) -with open('config.json') as config: - data = json.load(config) - proxystatus = data['proxy'] - messagestatus = data['random_messages'] - delay = data['delay'] -if messagestatus == True: - with ThreadPoolExecutor(max_workers=threadcount) as executor: - for x in range(threadcount): - executor.submit(main, username, messages(), deviceid(), proxy(), proxystatus) -else: - message = str(input(question+"Enter message: ")) - with ThreadPoolExecutor(max_workers=threadcount) as executor: - for x in range(threadcount): - executor.submit(main, username, message, deviceid(), proxy(), proxystatus) - time.sleep(delay) - +def handler(): + print(Fore.LIGHTRED_EX + ''' + ▒█▄░▒█ ▒█▀▀█ ▒█░░░   ▒█▀▀▀█ ▒█▀▀█ ░█▀▀█ ▒█▀▄▀█ + ▒█▒█▒█ ▒█░▄▄ ▒█░░░   ░▀▀▀▄▄ ▒█▄▄█ ▒█▄▄█ ▒█▒█▒█ + ▒█░░▀█ ▒█▄▄█ ▒█▄▄█   ▒█▄▄▄█ ▒█░░░ ▒█░▒█ ▒█░░▒█ + ''' + Fore.GREEN + 'Made by https://github.com/oxitheman' + '\nStar the repository on github if you like it!' + ' If you would like to send random questions or use proxies edit config.json to true.' + Style.RESET_ALL) + username = str(input("Enter username (Along with numbers in their NGL link): ")) + threadcount = int(input("Enter thread count: ")) + with open('config.json') as config: + data = json.load(config) + proxystatus = data['proxy'] + messagestatus = data['random_messages'] + delay = data['delay'] + if messagestatus == True: + with ThreadPoolExecutor(max_workers=threadcount) as executor: + for x in range(threadcount): + executor.submit(main, username, messages(), deviceid(), proxy(), proxystatus) + else: + message = str(input("Enter message: ")) + with ThreadPoolExecutor(max_workers=threadcount) as executor: + for x in range(threadcount): + executor.submit(main, username, message, deviceid(), proxy(), proxystatus) + time.sleep(delay) + Console.logger(f'Sent {sent} messages to {username}.', status='g') -print(info + f'Sent {sent} messages to {username}.') \ No newline at end of file +if __name__ == '__main__': + handler() \ No newline at end of file