├── .github └── workflows │ └── log.yml ├── README.md ├── TikTokBot.py ├── chromedriver.exe ├── log.md └── setup.bat /.github/workflows/log.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the workflow will run 6 | on: 7 | # Triggers the workflow on push or pull request events but only for the main branch 8 | push: 9 | branches: [ main ] 10 | workflow_dispatch: 11 | schedule: 12 | - cron: '0 */1 * * *' 13 | 14 | pull_request: 15 | branches: [ main ] 16 | 17 | # Allows you to run this workflow manually from the Actions tab 18 | 19 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 20 | jobs: 21 | # This workflow contains a single job called "build" 22 | build: 23 | # The type of runner that the job will run on 24 | runs-on: ubuntu-latest 25 | 26 | # Steps represent a sequence of tasks that will be executed as part of the job 27 | steps: 28 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 29 | - uses: actions/checkout@v3 30 | 31 | # Runs a single command using the runners shell 32 | - name: first commit 33 | run: date >> log.md 34 | 35 | # Runs a set of commands using the runners shell 36 | - name: second commit 37 | run: | 38 | git add . 39 | git config user.name 'Setiawan007' 40 | git config user.email 'febriantobagussetiawan@gmail.com' 41 | git commit -m "Jangan Lupa Follow @Setiawan007" 42 | git push 43 | 44 | - name: third commit 45 | run: sed -i '$ d' log.md 46 | 47 | - name: finishing 48 | run: | 49 | git add . 50 | git config user.name 'Setiawan007' 51 | git config user.email 'febriantobagussetiawan@gmail.com' 52 | git commit -m "Jangan Lupa Follow @Setiawan007" 53 | git push 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TikTok Bot 2 | Tool That Uses Zefoy To Bot Your TikTok Follow, Hearts, Views, & Shares! 3 | Update: Revamped, Updated the Xpath, Added custom botting option 4 | _______________________ 5 | ## SETUP 6 | (I recommend your python version to be 3.6 or Above) 7 | 1. Download Python (Add to Path, And Select Pip in Customize Installation) 8 | 3. Download Chrome Web Driver. 9 | 4. Install The Modules Required In Python Or Just Run `setup.bat` With Pip Installed. 10 | 5. Make Sure Your Selenium Version Is 4, You Can Upgrade By Executing ```pip install selenium --upgrade``` 11 | 6. In The Code, Put The File Location For The Chrome Web Driver EXE With Double Back Slash (Line #118). 12 | 7. Run It And Then Type Ur TikTok Video URL And Solve The Captcha And Type 'y' And It Will Start. 13 | 14 | ChromeDriver: https://chromedriver.chromium.org/downloads 15 | Download the Version that's the same version as your chrome 16 | _______________________ -------------------------------------------------------------------------------- /TikTokBot.py: -------------------------------------------------------------------------------- 1 | #TikTok Bot 2 | import time 3 | from colorama import Fore, init 4 | from selenium import webdriver 5 | from selenium.webdriver.chrome.service import Service 6 | from selenium.webdriver.common.by import By 7 | from os import system, get_terminal_size 8 | 9 | init() 10 | system("mode 800") 11 | system("title TikTok Bot -By Setiawan007") 12 | 13 | def color(str, color): 14 | if color.lower() == "green": 15 | result = f"{Fore.WHITE}[{Fore.LIGHTGREEN_EX}{str}{Fore.WHITE}]{Fore.LIGHTGREEN_EX}" 16 | 17 | elif color.lower() == "red": 18 | result = f"{Fore.WHITE}[{Fore.LIGHTRED_EX}{str}{Fore.WHITE}]{Fore.LIGHTRED_EX}" 19 | 20 | return result 21 | 22 | def align(str): 23 | lines = str.splitlines( ) 24 | greatest = [] 25 | for i in lines: 26 | greatest.append(len(i)) 27 | 28 | for i in lines: 29 | length = round(int(greatest[-1])/2) 30 | print(f"{' '*round(get_terminal_size().columns/2-length)}{i}") 31 | 32 | class printing(): 33 | 34 | def __init__(self, a, b, c, d): 35 | self.a = a 36 | self.b = b 37 | self.c = c 38 | self.d = d 39 | 40 | def text(): 41 | text = f"""{Fore.LIGHTMAGENTA_EX} 42 | \t\t\t\t\t▄▄▄▄▄▄▪ ▄ •▄ ▄▄▄▄▄ ▄ •▄ ▄▄▄▄· ▄▄▄▄▄ 43 | \t\t\t\t\t ██ ██ █▌▄▌▪•██ ▪ █▌▄▌▪ ▐█ ▀█▪▪ •██ 44 | \t\t\t\t\t ▐█.▪▐█·▐▀▀▄· ▐█.▪ ▄█▀▄ ▐▀▀▄· ▐█▀▀█▄ ▄█▀▄ ▐█.▪ 45 | \t\t\t\t\t ▐█▌·▐█▌▐█.█▌ ▐█▌·▐█▌.▐▌▐█.█▌ ██▄▪▐█▐█▌.▐▌ ▐█▌· 46 | \t\t\t\t\t ▀▀▀ ▀▀▀·▀ ▀ ▀▀▀ ▀█▄▀▪·▀ ▀ ·▀▀▀▀ ▀█▄▀▪ ▀▀▀ By: @Setiawan007 47 | """ 48 | text = text.replace('▪', f'{Fore.GREEN}▪{Fore.LIGHTMAGENTA_EX}') 49 | text = text.replace('•', f'{Fore.GREEN}•{Fore.LIGHTMAGENTA_EX}') 50 | text = text.replace('·', f'{Fore.GREEN}·{Fore.LIGHTMAGENTA_EX}') 51 | text = text.replace('.', f'{Fore.GREEN}.{Fore.LIGHTMAGENTA_EX}') 52 | align(text) 53 | 54 | def info(): 55 | align(f"""{Fore.WHITE} 56 | ╔═══════════════════════════════════════════════════════════════════════════════════╗ 57 | ║ ║ 58 | ║ {color(">", "green")} About: {Fore.LIGHTMAGENTA_EX}This Tool Uses Zefoy To Bot TikTok Stats.{Fore.WHITE} ║ 59 | ║ {color(">", "green")} Updates: {Fore.LIGHTMAGENTA_EX}Error Fix & Adjustment --9/15/2022{Fore.WHITE} ║ 60 | ║ {color(">", "green")} Made By: {Fore.LIGHTMAGENTA_EX}Setiawan007{Fore.WHITE} ║ 61 | ║ {color(">", "green")} Github: {Fore.LIGHTMAGENTA_EX}https://github.com/Setiawan007{Fore.WHITE} ║ 62 | ║ {color(">", "green")} Download Chrome Driver: {Fore.LIGHTMAGENTA_EX}https://chromedriver.chromium.org/downloads{Fore.WHITE} ║ 63 | ║ ║ 64 | ╚═══════════════════════════════════════════════════════════════════════════════════╝ 65 | """) 66 | 67 | def options(): 68 | align(f"""{Fore.WHITE} 69 | ╔═══════════════════════════════╗ 70 | ║ ║ 71 | ║ {color("1", "green")} {Fore.LIGHTMAGENTA_EX}Start{Fore.WHITE} ║ 72 | ║ {color("2", "green")} {Fore.LIGHTMAGENTA_EX}Info{Fore.WHITE} ║ 73 | ║ {color("3", "green")} {Fore.LIGHTMAGENTA_EX}Options{Fore.WHITE} ║ 74 | ║ {color("4", "green")} {Fore.LIGHTMAGENTA_EX}Clear{Fore.WHITE} ║ 75 | ║ {color("5", "green")} {Fore.LIGHTMAGENTA_EX}Exit{Fore.WHITE} ║ 76 | ║ ║ 77 | ╚═══════════════════════════════╝ 78 | """) 79 | 80 | def botOptions(): 81 | align(f"""{Fore.WHITE} 82 | ╔═══════════════════════════════╗ 83 | ║ ║ 84 | ║ {color("1", "green")} {Fore.LIGHTMAGENTA_EX}Follows{Fore.WHITE} ║ 85 | ║ {color("2", "green")} {Fore.LIGHTMAGENTA_EX}Hearts{Fore.WHITE} ║ 86 | ║ {color("3", "green")} {Fore.LIGHTMAGENTA_EX}Views{Fore.WHITE} ║ 87 | ║ {color("4", "green")} {Fore.LIGHTMAGENTA_EX}Shares{Fore.WHITE} ║ 88 | ║ {color("5", "green")} {Fore.LIGHTMAGENTA_EX}All{Fore.WHITE} ║ 89 | ║ ║ 90 | ╚═══════════════════════════════╝ 91 | """) 92 | 93 | def cooldowns(self): 94 | align(f"""{Fore.WHITE} 95 | ╔═══════════════════════════════╗ 96 | ║ {color(">", "green")} {Fore.LIGHTMAGENTA_EX}Cool Downs {color("<", "green")}║ 97 | ║ {color(">", "green")} {Fore.LIGHTMAGENTA_EX}Follows: {Fore.LIGHTCYAN_EX}{self.a}s{Fore.WHITE} ║ 98 | ║ {color(">", "green")} {Fore.LIGHTMAGENTA_EX}Hearts: {Fore.LIGHTCYAN_EX}{self.b}s{Fore.WHITE} ║ 99 | ║ {color(">", "green")} {Fore.LIGHTMAGENTA_EX}Views: {Fore.LIGHTCYAN_EX}{self.c}s{Fore.WHITE} ║ 100 | ║ {color(">", "green")} {Fore.LIGHTMAGENTA_EX}Shares: {Fore.LIGHTCYAN_EX}{self.d}s{Fore.WHITE} ║ 101 | ║ ║ 102 | ╚═══════════════════════════════╝ 103 | """) 104 | 105 | def refresh(): 106 | system("cls") 107 | printing.text() 108 | align(f"\n\n\t\t\t{color('>', 'green')} Made By: {Fore.LIGHTMAGENTA_EX}Dreamer#5114 {color('<', 'green')}") 109 | align(f"\t\t\t\t{color('>', 'green')} {Fore.LIGHTGREEN_EX}Github: {Fore.LIGHTMAGENTA_EX}https://github.com/Setiawan007/TikTokBot {color('<', 'green')}") 110 | printing.options() 111 | 112 | def start(video, botChoice): 113 | 114 | option = webdriver.ChromeOptions() 115 | option.add_experimental_option('excludeSwitches', ['enable-logging']) 116 | 117 | try: 118 | service = Service(executable_path="C:\\TikTok\\chromedriver.exe") 119 | driver = webdriver.Chrome(service=service, options=option) 120 | except Exception as DriverError: 121 | print(f"{color('>', 'red')} {Fore.LIGHTRED_EX}Error: {DriverError}") 122 | input(f"{color('>', 'red')} {Fore.LIGHTRED_EX}Press Enter to Exit") 123 | exit() 124 | 125 | driver.get("https://zefoy.com") 126 | 127 | if driver.title == "zefoy.com | 502: Bad gateway": 128 | print(f"{color('>', 'red')} Zefoy Is Down... Attempting To Fix.\n") 129 | while driver.title == "zefoy.com | 502: Bad gateway": 130 | time.sleep(20) 131 | driver.refresh() 132 | if driver.title != "zefoy.com | 502: Bad gateway": 133 | print(f"\n{color('>', 'red')} Fixed! Zefoy is Back Up. Starting Now.\n") 134 | break 135 | else: 136 | print(f"\n{color('>', 'green')} Zefoy Is Up!\n") 137 | 138 | captchaCheck = input(f"{color('>>>', 'green')} Type \"y\" Once You Finished The Captcha: {Fore.LIGHTMAGENTA_EX}") 139 | captchaFinish = False 140 | 141 | if captchaCheck == "y": 142 | while captchaFinish != True: 143 | try: 144 | driver.find_element(By.XPATH, "/html/body/div[4]/div[1]/div[3]/div/div[1]/div/h5") 145 | captchaFinish = True 146 | except: 147 | print(f"\n{color('>', 'red')} You Didn't Finish The Captcha.") 148 | input(f"{color('>>>', 'green')} Type \"y\" Once You Finished The Captcha: {Fore.LIGHTMAGENTA_EX}") 149 | 150 | #Defining Find Cooldown 151 | def findCooldown(xpath): 152 | cooldown = driver.find_element(By.XPATH, xpath).text 153 | 154 | #String Slicing For Minutes 155 | minute1 = cooldown.find("wait") + 4 156 | minute2 = minute1 157 | while True: 158 | minute2 += 1 159 | if cooldown[minute2] == "m": 160 | break 161 | 162 | #String Slicing For Seconds 163 | second1 = cooldown.find(")") + 1 164 | second2 = second1 165 | while True: 166 | second2 += 1 167 | if cooldown[second2] == "s": 168 | break 169 | 170 | #Returning Minutes & Second Added 171 | return (int(cooldown[minute1:minute2])*60) + int(cooldown[second1:second2]) 172 | 173 | print(f"\n{color('>', 'green')} Captcha is Finished, Starting...\n") 174 | 175 | #Defining Xpaths 176 | home = "/html/body/nav/ul/li/a" 177 | 178 | views_enter = "/html/body/div[4]/div[1]/div[3]/div/div[4]/div/button" 179 | views_input = "/html/body/div[4]/div[5]/div/form/div/input" 180 | views_search = "/html/body/div[4]/div[5]/div/form/div/div/button" 181 | views_submit = "/html/body/div[4]/div[5]/div/div/div[1]/div/form/button" 182 | views_cooldowns = "/html/body/div[4]/div[5]/div/div/h4" 183 | 184 | shares_enter = "/html/body/div[4]/div[1]/div[3]/div/div[5]/div/button" 185 | shares_input = "/html/body/div[4]/div[6]/div/form/div/input" 186 | shares_search = "/html/body/div[4]/div[6]/div/form/div/div/button" 187 | shares_submit = "/html/body/div[4]/div[6]/div/div/div[1]/div/form/button" 188 | shares_cooldowns = "/html/body/div[4]/div[6]/div/div/h4" 189 | 190 | hearts_enter = "/html/body/div[4]/div[1]/div[3]/div/div[2]/div/button" 191 | hearts_input = "/html/body/div[4]/div[3]/div/form/div/input" 192 | hearts_search = "/html/body/div[4]/div[3]/div/form/div/div/button" 193 | hearts_submit = "/html/body/div[4]/div[3]/div/div/div[1]/div/form/button" 194 | hearts_cooldowns = "/html/body/div[4]/div[3]/div/div/h4" 195 | 196 | follows_enter = "/html/body/div[4]/div[1]/div[3]/div/div[1]/div/button" 197 | follows_input = "/html/body/div[4]/div[2]/div/form/div/input" 198 | follows_search = "/html/body/div[4]/div[2]/div/form/div/div/button" 199 | follows_submit = "/html/body/div[4]/div[2]/div/div/div[1]/div/form/button" 200 | follows_cooldowns = "/html/body/div[4]/div[2]/div/div/h4" 201 | 202 | #List of Xpaths for the Bot All 203 | enterList = [ 204 | [follows_enter, follows_input, follows_search, follows_submit, follows_cooldowns, "Follows"], 205 | [views_enter, views_input, views_search, views_submit, views_cooldowns, "Views"], 206 | [hearts_enter, hearts_input, hearts_search, hearts_submit, hearts_cooldowns, "Hearts"], 207 | [shares_enter, shares_input, shares_search, shares_submit, shares_cooldowns, "Shares"], 208 | ] 209 | 210 | #Defining Cool-downs 211 | follows_cooldown = 0 212 | hearts_cooldown = 0 213 | views_cooldown = 0 214 | shares_cooldown = 0 215 | 216 | #Defining Boolean 217 | continue1 = False 218 | continue2 = False 219 | 220 | time.sleep(5) 221 | 222 | #Defining Botting Function, Uses XPaths as parameters 223 | def bot(which, enter, input, search, submit, con1, con2, cooldownText, cooldownTime): 224 | amount = 0 225 | while captchaFinish: 226 | driver.refresh() 227 | 228 | #Checks If Zefoy Down 229 | if driver.title == "zefoy.com | 502: Bad gateway": 230 | print(f"{color('>', 'red')} Zefoy Is Down... Attempting To Fix.\n") 231 | while driver.title == "zefoy.com | 502: Bad gateway": 232 | time.sleep(20) 233 | driver.refresh() 234 | if driver.title != "zefoy.com | 502: Bad gateway": 235 | print(f"\n{color('>', 'red')} Fixed! Zefoy is Back Up. Starting Now.\n") 236 | break 237 | 238 | print(f"{color('>', 'green')} Sending {which}...") 239 | try: 240 | driver.find_element(By.XPATH, enter).click() 241 | time.sleep(1) 242 | driver.find_element(By.XPATH, input).send_keys(video) 243 | con1 = True 244 | except: 245 | con1 = False 246 | print(f"\n{color('>', 'red')} {which} Page is Down on Zefoy.") 247 | print(f"{color('>', 'red')} Stopped.") 248 | time.sleep(1000000) 249 | if con1 == True: 250 | time.sleep(2) 251 | driver.find_element(By.XPATH, search).click() 252 | time.sleep(3) 253 | try: 254 | driver.find_element(By.XPATH, submit).click() 255 | con2 = True 256 | print(f"{color('>', 'green')} Sent {which}, Getting Cool Down\n") 257 | except: 258 | con2 = False 259 | print(f"{color('>', 'red')} {which} Cool Down Isn't Finished, Getting Cool Down.\n") 260 | time.sleep(5) 261 | cooldownTime += findCooldown(cooldownText) 262 | if con2 == True: 263 | time.sleep(5) 264 | cooldownTime += findCooldown(cooldownText) 265 | else: 266 | pass 267 | else: 268 | pass 269 | 270 | amount += 1 271 | driver.find_element(By.XPATH, home).click() 272 | print(f"{color('>', 'green')} Completed {Fore.LIGHTCYAN_EX}{amount} {Fore.LIGHTGREEN_EX}Time.") 273 | print(f"{color('>', 'green')} Cooldown: {Fore.LIGHTCYAN_EX}{cooldownTime}s\n") 274 | for i in range(10): 275 | time.sleep(cooldownTime/10) 276 | driver.refresh() 277 | print(f"{color('>', 'green')} Cool-Down: {Fore.LIGHTCYAN_EX}{i+1}/10") 278 | 279 | print(f"\n{color('>', 'green')} Finished Cool Down, Restarting...\n") 280 | time.sleep(5) 281 | 282 | def botAll(boolean): 283 | amount = 0 284 | while True: 285 | 286 | #Checks If Zefoy Down 287 | if driver.title == "zefoy.com | 502: Bad gateway": 288 | print(f"{color('>', 'red')} Zefoy Is Down... Attempting To Fix.\n") 289 | while driver.title == "zefoy.com | 502: Bad gateway": 290 | time.sleep(20) 291 | driver.refresh() 292 | if driver.title != "zefoy.com | 502: Bad gateway": 293 | print(f"\n{color('>', 'red')} Fixed! Zefoy is Back Up. Starting Now.\n") 294 | break 295 | 296 | driver.refresh() 297 | cooldownList = [] 298 | if boolean: 299 | for i in enterList: 300 | time.sleep(3) 301 | print(f"{color('>', 'green')} Sending {i[5]}...") 302 | try: 303 | driver.find_element(By.XPATH, i[0]).click() 304 | time.sleep(1) 305 | driver.find_element(By.XPATH, i[1]).send_keys(video) 306 | continue1 = True 307 | except: 308 | print(f"{color('>', 'red')} {i[5]} Page is Down on Zefoy.\n") 309 | cooldownList.append(0) 310 | continue1 = False 311 | driver.find_element(By.XPATH, home) 312 | 313 | if continue1 == True: 314 | time.sleep(2) 315 | driver.find_element(By.XPATH, i[2]).click() 316 | time.sleep(3) 317 | 318 | try: 319 | driver.find_element(By.XPATH, i[3]).click() 320 | continue2 = True 321 | print(f"{color('>', 'green')} Sent {i[5]}, Getting Cool Down.\n") 322 | except: 323 | print(f"{color('>', 'red')} {i[5]} Cool Down Isn't Finished, Getting Cool Down.\n") 324 | time.sleep(5) 325 | cooldownList.append(findCooldown(i[4])) 326 | driver.find_element(By.XPATH, home).click() 327 | continue2 = False 328 | 329 | if continue2 == True: 330 | time.sleep(5) 331 | cooldownList.append(findCooldown(i[4])) 332 | driver.refresh() 333 | else: 334 | pass 335 | else: 336 | pass 337 | 338 | amount +=1 339 | cooldownList.sort() 340 | 341 | 342 | print(f"{color('>', 'green')} Completed {amount} Time.") 343 | print(f"{color('>', 'green')} Cooldown: {Fore.LIGHTCYAN_EX}{cooldownList[-1]}s\n") 344 | 345 | for i in range(10): 346 | time.sleep(cooldownList[-1]/10) 347 | driver.refresh() 348 | print(f"{color('>', 'green')} Cool-Down: {Fore.LIGHTCYAN_EX}{i+1}/10") 349 | 350 | time.sleep(5) 351 | print(f"\n{color('>', 'green')} Finished Cool Down, Restarting...\n") 352 | driver.refresh() 353 | 354 | if botChoice == 1: 355 | bot("Follows", follows_enter, follows_input, follows_search, follows_submit, continue1, continue2, follows_cooldowns, follows_cooldown) 356 | elif botChoice == 2: 357 | bot("Hearts", hearts_enter, hearts_input, hearts_search, hearts_submit, continue1, continue2, hearts_cooldowns, hearts_cooldown) 358 | elif botChoice == 3: 359 | bot("Views", views_enter, views_input, views_search, views_submit, continue1, continue2, views_cooldowns, views_cooldown) 360 | elif botChoice == 4: 361 | bot("Shares", shares_enter, shares_input, shares_search, shares_submit, continue1, continue2, shares_cooldowns, shares_cooldown) 362 | elif botChoice == 5: 363 | botAll(True) 364 | 365 | printing.refresh() 366 | 367 | while True: 368 | choice = input(f"{color('>>>', 'green')} Choice: {Fore.LIGHTMAGENTA_EX}") 369 | if choice == "1": 370 | video = input(f"{color('>>>', 'green')} TikTok Video URL: {Fore.LIGHTMAGENTA_EX}") 371 | printing.botOptions() 372 | option = input(f"\n{color('>>>', 'green')} Which to Bot: {Fore.LIGHTMAGENTA_EX}") 373 | start(video, int(option)) 374 | break 375 | 376 | elif choice == "2": 377 | printing.info() 378 | elif choice == "3": 379 | printing.options() 380 | elif choice == "4": 381 | printing.refresh() 382 | elif choice =="5": 383 | exit() 384 | -------------------------------------------------------------------------------- /chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Setiawan007/TikTokBot/e776b45d0061c49e491bd8efe7a8467082ad4bac/chromedriver.exe -------------------------------------------------------------------------------- /log.md: -------------------------------------------------------------------------------- 1 | 2 | Tue May 30 19:11:10 UTC 2023 3 | -------------------------------------------------------------------------------- /setup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | color 0A 3 | cls 4 | echo Downloading Modules... 5 | python -m pip install colorama 6 | python -m pip install selenium 7 | python -m pip install time 8 | python -m pip install os 9 | echo Done 10 | pause 11 | --------------------------------------------------------------------------------