Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
-Removed fake_useragent
-Added new UserAgent rotation
-Removed beautifulsoup
-Added webhook retry counter
-Added invalids counter
-Added better webhook support (embed)
-Added new Ascii Art
-Added lowercase option
-Added uppercase option
-Added uppercase & lowercase option
-Added only digits option
-Fixed a threading issue with usernames.txt
-Now it writes the invalids separatedly to a txt
  • Loading branch information
onemanbuilds committed Nov 9, 2020
1 parent 5306f58 commit 5d13f8a
Show file tree
Hide file tree
Showing 4 changed files with 2,312 additions and 77 deletions.
3 changes: 3 additions & 0 deletions configs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"token":"yourtokenhere"
}
200 changes: 126 additions & 74 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from sys import stdout
from random import choice
from threading import Thread,Lock,active_count
from fake_useragent import UserAgent
from string import ascii_letters,digits
from string import ascii_letters,ascii_lowercase,ascii_uppercase,digits
from time import sleep
from bs4 import BeautifulSoup
from urllib3 import disable_warnings
from datetime import datetime
import requests
import json

Expand All @@ -29,6 +29,11 @@ def PrintText(self,bracket_color:Fore,text_in_bracket_color:Fore,text_in_bracket
stdout.write(Style.BRIGHT+bracket_color+'['+text_in_bracket_color+text_in_bracket+bracket_color+'] '+bracket_color+text+'\n')
self.lock.release()

def ReadConfig(self):
with open('configs.json','r') as f:
config = json.load(f)
return config

def ReadFile(self,filename,method):
with open(filename,method) as f:
content = [line.strip('\n') for line in f]
Expand All @@ -54,152 +59,199 @@ def GetRandomProxy(self):
}
return proxies

def GetRandomUserAgent(self):
useragents = self.ReadFile('useragents.txt','r')
return choice(useragents)

def TitleUpdate(self):
while True:
self.SetTitle('One Man Builds TikTok Username Checker ^& Generator ^| AVAILABLES: {0} ^| TAKENS: {1} ^| RETRIES: {2} ^| THREADS: {3}'.format(self.availables,self.takens,self.retries,active_count()-1))
self.SetTitle(f'One Man Builds TikTok Username Checker ^& Generator ^| AVAILABLES: {self.availables} ^| TAKENS: {self.takens} ^| INVALIDS: {self.invalids} ^| RETRIES: {self.retries} ^| WEBHOOK RETRIES: {self.webhook_retries} ^| THREADS: {active_count()-1}')
sleep(0.1)

def __init__(self):
init(convert=True)
self.clear()
self.SetTitle('One Man Builds TikTok Username Checker ^& Generator')
self.title = Style.BRIGHT+Fore.RED+"""
_____ ___ _ _______ ___ _ __ _ _ ____ _____ ____ _ _ _ __ __ _____
|_ _|_ _| |/ /_ _/ _ \| |/ / | | | / ___|| ____| _ \| \ | | / \ | \/ | ____|
| | | || ' / | || | | | ' / | | | \___ \| _| | |_) | \| | / _ \ | |\/| | _|
| | | || . \ | || |_| | . \ | |_| |___) | |___| _ <| |\ |/ ___ \| | | | |___
|_| |___|_|\_\ |_| \___/|_|\_\ \___/|____/|_____|_| \_\_| \_/_/ \_\_| |_|_____|
____ _ _ _____ ____ _ _______ ____
/ ___| | | | ____/ ___| |/ / ____| _ \
| | | |_| | _|| | | ' /| _| | |_) |
| |___| _ | |__| |___| . \| |___| _ <
\____|_| |_|_____\____|_|\_\_____|_| \_\
╔═════════════════════════════════════════════════════════════════════╗
╔╦╗╦╦╔═╔╦╗╔═╗╦╔═ ╦ ╦╔═╗╔═╗╦═╗╔╗╔╔═╗╔╦╗╔═╗ ╔═╗╦ ╦╔═╗╔═╗╦╔═╔═╗╦═╗
║ ║╠╩╗ ║ ║ ║╠╩╗ ║ ║╚═╗║╣ ╠╦╝║║║╠═╣║║║║╣ ║ ╠═╣║╣ ║ ╠╩╗║╣ ╠╦╝
╩ ╩╩ ╩ ╩ ╚═╝╩ ╩ ╚═╝╚═╝╚═╝╩╚═╝╚╝╩ ╩╩ ╩╚═╝ ╚═╝╩ ╩╚═╝╚═╝╩ ╩╚═╝╩╚═
╚═════════════════════════════════════════════════════════════════════╝
"""
print(self.title)

self.token = self.ReadConfig()['token']

self.availables = 0
self.takens = 0
self.invalids = 0
self.retries = 0
self.ua = UserAgent()
self.webhook_retries = 0

self.lock = Lock()
self.use_proxy = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] ['+Fore.RED+'1'+Fore.CYAN+']Proxy ['+Fore.RED+'0'+Fore.CYAN+']Proxyless: '))


self.proxy_type = ''

if self.use_proxy == 1:
self.proxy_type = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] ['+Fore.RED+'1'+Fore.CYAN+']Https ['+Fore.RED+'2'+Fore.CYAN+']Socks4 ['+Fore.RED+'3'+Fore.CYAN+']Socks5: '))

self.method = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] ['+Fore.RED+'1'+Fore.CYAN+']Brute ['+Fore.RED+'0'+Fore.CYAN+']From Usernames.txt: '))
self.enable_webhook = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] ['+Fore.RED+'1'+Fore.CYAN+']Enable Webhook ['+Fore.RED+'0'+Fore.CYAN+']No Webhook: '))
self.threads_num = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Threads: '))

if self.enable_webhook == 1:
self.webhook_url = str(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Webhook URL: '))


self.threads_num = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Threads: '))

print('')

def Start(self):
Thread(target=self.TitleUpdate).start()
if self.method == 1:
username_length = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Length: '))
include_digits = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Include Digits ['+Fore.RED+'1'+Fore.CYAN+']yes ['+Fore.RED+'0'+Fore.CYAN+']no: '))
case = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] ['+Fore.RED+'1'+Fore.CYAN+']Lowercase ['+Fore.RED+'2'+Fore.CYAN+']Uppercase ['+Fore.RED+'3'+Fore.CYAN+']Both ['+Fore.RED+'4'+Fore.CYAN+']Only Digits: '))

include_digits = 0

if case != 4:
include_digits = int(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Include Digits ['+Fore.RED+'1'+Fore.CYAN+']yes ['+Fore.RED+'0'+Fore.CYAN+']no: '))

prefix = str(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Prefix (leave it blank if you dont want to use): '))
suffix = str(input(Style.BRIGHT+Fore.CYAN+'['+Fore.RED+'>'+Fore.CYAN+'] Suffix (leave it blank if you dont want to use): '))
print('')

Run = True
while Run:
if active_count()<=self.threads_num:
name = self.GenName(username_length,include_digits,prefix,suffix)
name = self.GenName(username_length,include_digits,case,prefix,suffix)
Thread(target=self.TikTokUsernameCheck,args=(name,)).start()
else:
usernames = self.ReadFile('usernames.txt','r')
for username in usernames:
Run = True
while Run:
if active_count()<=self.threads_num:
Thread(target=self.TikTokUsernameCheck,args=(username,)).start()
Run = False

if active_count()<=self.threads_num:
Thread(target=self.TikTokUsernameCheck,args=(username,)).start()
Run = False

def GenName(self,length,include_digits,prefix,suffix):
if include_digits == 1:
name = prefix+''.join(choice(ascii_letters+digits) for num in range(length))+suffix
def GenName(self,length,include_digits,case,prefix,suffix):
if case == 1:
if include_digits == 1:
name = prefix+''.join(choice(ascii_lowercase+digits) for num in range(length))+suffix
else:
name = prefix+''.join(choice(ascii_lowercase) for num in range(length))+suffix
elif case == 2:
if include_digits == 1:
name = prefix+''.join(choice(ascii_uppercase+digits) for num in range(length))+suffix
else:
name = prefix+''.join(choice(ascii_uppercase) for num in range(length))+suffix
elif case == 3:
if include_digits == 1:
name = prefix+''.join(choice(ascii_letters+digits) for num in range(length))+suffix
else:
name = prefix+''.join(choice(ascii_letters) for num in range(length))+suffix
elif case == 4:
name = prefix+''.join(choice(digits) for num in range(length))+suffix
else:
name = prefix+''.join(choice(ascii_letters) for num in range(length))+suffix
if include_digits == 1:
name = prefix+''.join(choice(ascii_lowercase+digits) for num in range(length))+suffix
else:
name = prefix+''.join(choice(ascii_lowercase) for num in range(length))+suffix

return name

def SendWebhook(self,message,proxy):
try:
if 'https://discord.com/api/webhooks/' in self.webhook_url:
message_to_send = {'content':message}

headers = {
'User-Agent':self.ua.random,
'Pragma':'no-cache',
'Accept':'*/*',
'Content-Type':'application/json'
}

payload = json.dumps(message_to_send)

if self.use_proxy == 1:
response = requests.post(self.webhook_url,data=payload,headers=headers,proxies=proxy)
else:
response = requests.post(self.webhook_url,data=payload,headers=headers)

if response.text == "":
self.PrintText(Fore.CYAN,Fore.RED,'WEBHOOK','MESSAGE {0} SENT'.format(message))
elif "You are being rate limited." in response.text:
self.PrintText(Fore.RED,Fore.CYAN,'WEBHOOK','YOU ARE RATELIMITED')
else:
self.PrintText(Fore.RED,Fore.CYAN,'WEBHOOK','SOMETHING WENT WRONG RETRY')
self.SendWebhook(message)
timestamp = str(datetime.utcnow())

message_to_send = {"embeds": [{"title": "TIKTOK AVAILABLE USERNAME","description": message,"color": 65362,"author": {"name": "AUTHOR'S DISCORD SERVER [CLICK HERE]","url": "https://discord.gg/33UzcuY","icon_url": "https://media.discordapp.net/attachments/774991492690608159/774991574953623582/onemanbuildslogov3.png"},"footer": {"text": "MADE BY ONEMANBUILDS","icon_url": "https://media.discordapp.net/attachments/774991492690608159/774991574953623582/onemanbuildslogov3.png"},"timestamp": timestamp,"image": {"url": "https://media2.giphy.com/media/QC1Gp8ZTABAyzYhraI/source.gif"}}]}

headers = {
'User-Agent':self.GetRandomUserAgent(),
'Pragma':'no-cache',
'Accept':'*/*',
'Content-Type':'application/json'
}

payload = json.dumps(message_to_send)

if self.use_proxy == 1:
response = requests.post(self.webhook_url,data=payload,headers=headers,proxies=proxy)
else:
response = requests.post(self.webhook_url,data=payload,headers=headers)

if response.text == "":
self.PrintText(Fore.CYAN,Fore.RED,'WEBHOOK',f'MESSAGE {message} SENT')
elif "You are being rate limited." in response.text:
self.SendWebhook(message,proxy)
self.webhook_retries += 1
#self.PrintText(Fore.RED,Fore.CYAN,'WEBHOOK','YOU ARE RATELIMITED')
else:
#self.PrintText(Fore.RED,Fore.CYAN,'WEBHOOK','SOMETHING WENT WRONG RETRY')
self.SendWebhook(message,proxy)
self.webhook_retries += 1
except:
self.SendWebhook(message)
self.SendWebhook(message,proxy)
self.webhook_retries += 1

def TikTokUsernameCheck(self,name):
try:
session = requests.session()

link = 'https://www.tiktok.com/@{0}/'.format(name)
link = f'https://www.tiktok.com/api/uniqueid/check/?aid=1233&unique_id={name}'

headers = {
'User-Agent':self.ua.random,
'User-Agent':self.GetRandomUserAgent()
}

cookies = {
'sessionid':self.token
}

response = ''

proxy = self.GetRandomProxy()

if self.use_proxy == 1:
response = session.get(link,headers=headers,proxies=proxy)
response = requests.get(link,headers=headers,cookies=cookies,proxies=proxy,verify=False)
else:
response = session.get(link,headers=headers)

soup = BeautifulSoup(response.text,'html.parser')
response = requests.get(link,headers=headers,cookies=cookies,verify=False)


statuscode = response.json()['status_code']

#available_text =
#taken_text = ''

if soup.find('p',{'class':'jsx-4111167561 title'}).text == "Couldn't find this account":
self.availables = self.availables+1
#3254 the usernames cant contain numbers only
#3252 Your username can have up to 24 characters
#3250 Only letters, numbers, underscores, or periods are allowed
#3249 This username isn?t available. Try a suggested username, or enter a new one.
#0 the username is available

if statuscode == 0:
self.PrintText(Fore.CYAN,Fore.RED,'AVAILABLE',name)
with open('availables.txt','a',encoding='utf8') as f:
f.write(name+'\n')

f.write(f'{name}\n')
self.availables += 1
if self.enable_webhook == 1:
self.SendWebhook('[AVAILABLE] {0}'.format(name),proxy)

elif soup.find('meta',{'property':'twitter:creator'})['content'] == name:
self.takens = self.takens+1
self.SendWebhook(name,proxy)
elif statuscode == 3249:
self.PrintText(Fore.RED,Fore.CYAN,'TAKEN',name)
with open('takens.txt','a',encoding='utf8') as f:
f.write(name+'\n')
else:
f.write(f'{name}\n')
self.takens += 1
elif statuscode == 3254 or statuscode == 3252 or statuscode == 3250:
self.PrintText(Fore.RED,Fore.CYAN,'INVALID',name)
with open('invalids.txt','a',encoding='utf8') as f:
f.write(f'{name}\n')
self.invalids += 1
else:
self.retries = self.retries+1
self.TikTokUsernameCheck(name)
except:
self.retries = self.retries+1
self.TikTokUsernameCheck(name)


if __name__ == '__main__':
disable_warnings()
main = Main()
main.Start()
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
requests==2.24.0
fake_useragent==0.1.11
colorama==0.4.4
beautifulsoup4==4.9.3
urllib3==1.25.11
requests==2.24.0
Loading

0 comments on commit 5d13f8a

Please sign in to comment.