Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
xtekky
GitHub Repository: xtekky/tiktok-viewbot
Path: blob/main/test.py
617 views
1
try:
2
import undetected_chromedriver as uc
3
from colorama import Fore, init, Style
4
import ctypes, platform, os, time
5
import selenium, requests, webbrowser
6
7
except ImportError:
8
input("You do not have all of the modules required installed.")
9
os._exit(1)
10
11
text = """
12
███████ ███████ ███████ ██████ ██ ██
13
███ ██ ██ ██ ██ ██ ██
14
███ █████ █████ ██ ██ ████
15
███ ██ ██ ██ ██ ██
16
███████ ███████ ██ ██████ ██ """
17
18
19
class zefoy:
20
21
def __init__(self):
22
self.driver = uc.Chrome()
23
self.captcha_box = '/html/body/div[5]/div[2]/form/div/div'
24
self.clear = "clear"
25
26
if platform.system() == "Windows":
27
self.clear = "cls"
28
29
self.color = Fore.BLUE
30
self.sent = 0
31
self.xpaths = {
32
"followers" : "/html/body/div[6]/div/div[2]/div/div/div[2]/div/button",
33
"hearts" : "/html/body/div[6]/div/div[2]/div/div/div[3]/div/button",
34
"comment_hearts": "/html/body/div[6]/div/div[2]/div/div/div[4]/div/button",
35
"views" : "/html/body/div[6]/div/div[2]/div/div/div[5]/div/button",
36
"shares" : "/html/body/div[6]/div/div[2]/div/div/div[6]/div/button",
37
"favorites" : "/html/body/div[6]/div/div[2]/div/div/div[7]/div/button",
38
}
39
40
def main(self):
41
os.system(self.clear)
42
self.change_title("TikTok Automator using zefoy.com | Github: @xtekky")
43
44
print(self.color + text)
45
print("\n" + self._print("Waiting for Zefoy to load... 502 Error = Blocked country or VPN is on"))
46
47
self.driver.get("https://zefoy.com")
48
self.wait_for_xpath(self.captcha_box)
49
50
print(self._print("Site loaded, enter the CAPTCHA to continue."))
51
print(self._print("Waiting for you..."))
52
53
self.wait_for_xpath(self.xpaths["followers"])
54
os.system(self.clear)
55
status = self.check_status()
56
57
print(self.color + text)
58
print()
59
print(self._print(f"Join our {self.color}Discord Server{Fore.WHITE} for exclusive FREE tools."))
60
print(self._print(f"You can also get updates when Zefoy updates the bots and more."))
61
print(self._print(f"Select your option below." + "\n"))
62
63
counter = 1
64
for thing in status:
65
print(self._print(f"{thing} {status[thing]}", counter))
66
counter += 1
67
68
print(self._print(f"Discord / Support", "7"))
69
option = int(input("\n" + self._print(f"")))
70
71
if option == 1:
72
div = "7"
73
self.driver.find_element("xpath", self.xpaths["followers"]).click()
74
75
elif option == 2:
76
div = "8"
77
self.driver.find_element("xpath", self.xpaths["hearts"]).click()
78
79
elif option == 3:
80
div = "9"
81
self.driver.find_element("xpath", self.xpaths["comment_hearts"]).click()
82
83
elif option == 4: #Views
84
div = "10"
85
self.driver.find_element("xpath", self.xpaths["views"]).click()
86
87
elif option == 5:
88
div = "11"
89
self.driver.find_element("xpath", self.xpaths["shares"]).click()
90
91
elif option == 6:
92
div = "12"
93
self.driver.find_element("xpath", self.xpaths["favorites"]).click()
94
95
elif option == 7:
96
webbrowser.open('discord.gg/onlp')
97
os._exit(1)
98
99
else:
100
os._exit(1)
101
102
video_url_box = f'/html/body/div[{div}]/div/form/div/input'
103
search_box = f'/html/body/div[{div}]/div/form/div/div/button'
104
vid_info = input("\n" + self._print(f"Username/VideoURL: "))
105
106
self.send_bot(search_box, video_url_box, vid_info, div)
107
108
def send_bot(self, search_button, main_xpath, vid_info, div):
109
element = self.driver.find_element('xpath', main_xpath)
110
element.clear()
111
element.send_keys(vid_info)
112
self.driver.find_element('xpath', search_button).click()
113
time.sleep(3)
114
115
ratelimit_seconds, full = self.check_submit(div)
116
if "(s)" in str(full):
117
self.main_sleep(ratelimit_seconds)
118
self.driver.find_element('xpath', search_button).click()
119
time.sleep(2)
120
121
time.sleep(3)
122
123
send_button = f'/html/body/div[{div}]/div/div/div[1]/div/form/button'
124
self.driver.find_element('xpath', send_button).click()
125
self.sent += 1
126
print(self._print(f"Sent {self.sent} times."))
127
128
time.sleep(4)
129
self.send_bot(search_button, main_xpath, vid_info, div)
130
131
def main_sleep(self, delay):
132
while delay != 0:
133
time.sleep(1)
134
delay -= 1
135
self.change_title(f"TikTok Zefoy Automator using Zefoy.com | Cooldown: {delay}s | Github: @useragents")
136
137
def convert(self, min, sec):
138
seconds = 0
139
140
if min != 0:
141
answer = int(min) * 60
142
seconds += answer
143
144
seconds += int(sec) + 5
145
return seconds
146
147
def check_submit(self, div):
148
remaining = f"/html/body/div[{div}]/div/div/h4"
149
150
try:
151
element = self.driver.find_element("xpath", remaining)
152
except:
153
return None, None
154
155
if "READY" in element.text:
156
return True, True
157
158
if "seconds for your next submit" in element.text:
159
output = element.text.split("Please wait ")[1].split(" for")[0]
160
minutes = element.text.split("Please wait ")[1].split(" ")[0]
161
seconds = element.text.split("(s) ")[1].split(" ")[0]
162
sleep_duration = self.convert(minutes, seconds)
163
164
return sleep_duration, output
165
166
return element.text, None
167
168
def check_status(self):
169
statuses = {}
170
171
for thing in self.xpaths:
172
value = self.xpaths[thing]
173
element = self.driver.find_element('xpath', value)
174
175
if not element.is_enabled():
176
statuses.update({thing: f"{Fore.RED}[OFFLINE]"})
177
178
else:
179
statuses.update({thing: f"{Fore.GREEN}[WORKS]"})
180
181
return statuses
182
183
def _print(self, msg, status = "-"):
184
return f" {Fore.WHITE}[{self.color}{status}{Fore.WHITE}] {msg}"
185
186
def change_title(self, arg):
187
if self.clear == "cls":
188
ctypes.windll.kernel32.SetConsoleTitleW(arg)
189
190
def wait_for_xpath(self, xpath):
191
while True:
192
try:
193
f = self.driver.find_element('xpath', xpath)
194
return True
195
except selenium.common.exceptions.NoSuchElementException:
196
pass
197
198
if __name__ == "__main__":
199
obj = zefoy()
200
obj.main()
201
input()
202