Advertisement
OMG_klix

auto zefoy bot

May 7th, 2022 (edited)
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.52 KB | None | 0 0
  1.  
  2.  
  3. try:
  4. from selenium import webdriver
  5. import time, os, ctypes, requests
  6. from colorama import Fore, init
  7. import warnings, selenium, platform
  8. except ImportError:
  9. input("Error while importing modules. Please install the modules in requirements.txt")
  10.  
  11. init(convert = True, autoreset = True)
  12. warnings.filterwarnings("ignore", category=DeprecationWarning)
  13.  
  14. clear = "clear"
  15. if platform.system() == "Windows":
  16. clear = "cls"
  17.  
  18. os.system(clear)
  19.  
  20. ascii_text = f"""{Fore.RED}
  21. ████████▀▀▀████
  22. ████████────▀██
  23. ████████──█▄──█
  24. ███▀▀▀██──█████
  25. █▀──▄▄██──█████
  26. █──█████──█████
  27. █▄──▀▀▀──▄█████
  28. ███▄▄▄▄▄███████ https://discord.gg/b7eBSv6Vdd
  29. """
  30.  
  31. class automator:
  32.  
  33. def __init__(self):
  34. options = webdriver.ChromeOptions()
  35. options.add_argument('--ignore-certificate-errors')
  36. options.add_experimental_option("excludeSwitches", ["enable-logging"])
  37. self.xpaths = {
  38. "followers": "/html/body/div[4]/div[1]/div[3]/div/div[1]/div/button",
  39. "likes": "/html/body/div[4]/div[1]/div[3]/div/div[2]/div/button",
  40. "views": "/html/body/div[4]/div[1]/div[3]/div/div[4]/div/button",
  41. "shares": "/html/body/div[4]/div[1]/div[3]/div/div[5]/div/button"
  42. }
  43. try:
  44. self.driver = webdriver.Chrome(options = options)
  45. except Exception as e:
  46. self.error(f"Error trying to load web driver: {e}")
  47. self.status = {}
  48. self.sent = 0
  49. self.cooldowns = 0
  50. self.ratelimits = 0
  51.  
  52. def check_status(self):
  53. for xpath in self.xpaths:
  54. value = self.xpaths[xpath]
  55. element = self.driver.find_element_by_xpath(value)
  56. if not element.is_enabled():
  57. self.status.update({xpath: "[OFFLINE]"})
  58. else:
  59. self.status.update({xpath: ""})
  60.  
  61. def check_for_captcha(self):
  62. while True:
  63. try:
  64. if "Enter the word" not in self.driver.page_source:
  65. return
  66. except:
  67. return
  68. os.system(clear)
  69. print(ascii_text)
  70. print(f"{self.console_msg('Error')} Complete the CAPTCHA in the driver.")
  71. time.sleep(1)
  72.  
  73. def console_msg(self, status):
  74. colour = Fore.RED
  75. if status == "Success":
  76. colour = Fore.GREEN
  77. return f" {Fore.WHITE}[{colour}{status}{Fore.WHITE}]"
  78.  
  79. def update_ascii(self):
  80. options = f"""
  81. {self.console_msg("1")} Follower Bot {Fore.RED}{self.status["followers"]}
  82. {self.console_msg("2")} Like Video Bot {Fore.RED}{self.status["likes"]}
  83. {self.console_msg("3")} View Bot {Fore.RED}{self.status["views"]}
  84. {self.console_msg("4")} Share Bot {Fore.RED}{self.status["shares"]}
  85. """
  86. return ascii_text + options
  87.  
  88. def check_url(self, url):
  89. redirect = True
  90. if "vm.tiktok.com/" in url:
  91. redirect = False
  92. if redirect:
  93. if "/video/" not in url:
  94. return False
  95. session = requests.Session()
  96. r = session.get(url, allow_redirects=redirect)
  97. if redirect:
  98. if r.status_code == 200:
  99. return True
  100. return False
  101. location = r.headers["Location"]
  102. if "/video" in location:
  103. return True
  104. return False
  105.  
  106. def convert(self, min, sec):
  107. seconds = 0
  108. if min != 0:
  109. answer = int(min) * 60
  110. seconds += answer
  111. seconds += int(sec) + 15
  112. return seconds
  113.  
  114. def check_submit(self, div):
  115. remaining = f"/html/body/div[4]/div[{div}]/div/div/h4"
  116. try:
  117. element = self.driver.find_element_by_xpath(remaining)
  118. except:
  119. return None, None
  120. if "READY" in element.text:
  121. return True, True
  122. if "seconds for your next submit" in element.text:
  123. output = element.text.split("Please wait ")[1].split(" for")[0]
  124. minutes = element.text.split("Please wait ")[1].split(" ")[0]
  125. seconds = element.text.split("(s) ")[1].split(" ")[0]
  126. sleep_duration = self.convert(m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement