Advertisement
xtekky_

Untitled

Jul 25th, 2022
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.95 KB | None | 0 0
  1. import requests, time, urllib.parse, hashlib, json, threading, os, datetime, random, sys, cursor; from pystyle import *
  2.  
  3. def _xspaces(text: str):
  4. try:
  5. col = os.get_terminal_size().columns
  6. except OSError:
  7. return 0
  8. textl = text.splitlines()
  9. ntextl = max((len(v) for v in textl if v.strip()), default = 0)
  10. return int((col - ntextl) / 2)
  11.  
  12. # def pinkred(text: str):
  13. # os.system(""); faded = ""
  14. # blue = 255
  15. # for line in text:
  16. # faded += (f"\033[38;2;255;0;{blue}m{line}\033[0m")
  17. # if not blue == 0:
  18. # blue -= 5
  19. # if blue < 0:
  20. # blue = 0
  21. # return faded
  22.  
  23. class Xgorgon:
  24. def __init__(self, params: str, data: str, cookies: str) -> None:
  25.  
  26. self.params = params
  27. self.data = data
  28. self.cookies = cookies
  29.  
  30. def hash(self, data: str) -> str:
  31. _hash = str(
  32. hashlib.md5(
  33. data.encode()
  34. ).hexdigest()
  35. )
  36.  
  37. return _hash
  38.  
  39. def get_base_string(self) -> str:
  40. base_str = self.hash(self.params)
  41. base_str = (
  42. base_str + self.hash(self.data)
  43. if self.data
  44. else base_str + str(
  45. "0"
  46. *
  47. 32
  48. )
  49. )
  50. base_str = (
  51. base_str + self.hash(self.cookies)
  52. if self.cookies
  53. else base_str + str(
  54. "0"
  55. *
  56. 32
  57. )
  58. )
  59.  
  60. return base_str
  61.  
  62. def get_value(self) -> json:
  63. base_str = self.get_base_string()
  64.  
  65. return self.encrypt(base_str)
  66.  
  67. def encrypt(self, data: str) -> json:
  68. unix = int(time.time())
  69. len = 0x14
  70. key =[0xDF ,0x77 ,0xB9 ,0x40 ,0xB9 ,0x9B ,0x84 ,0x83 ,0xD1 ,0xB9 ,0xCB ,0xD1 ,0xF7 ,0xC2 ,0xB9 ,0x85 ,0xC3 ,0xD0 ,0xFB ,0xC3 ,]
  71.  
  72. param_list = []
  73.  
  74. for i in range(0, 12, 4):
  75. temp = data[8 * i : 8 * (i + 1)]
  76. for j in range(4):
  77. H = int(temp[j * 2 : (j + 1) * 2], 16)
  78. param_list.append(H)
  79.  
  80. param_list.extend(
  81. [
  82. 0x0, 0x6, 0xB, 0x1C
  83. ]
  84. )
  85.  
  86. H = int(
  87. hex(
  88. unix
  89. )
  90. , 16
  91. )
  92.  
  93. param_list.append(
  94. (
  95. H & 0xFF000000
  96. )
  97. >> 24
  98. )
  99. param_list.append(
  100. (
  101. H & 0x00FF0000
  102. )
  103. >> 16
  104. )
  105. param_list.append(
  106. (
  107. H & 0x0000FF00
  108. )
  109. >> 8
  110. )
  111. param_list.append(
  112. (
  113. H & 0x000000FF
  114. )
  115. >> 0
  116. )
  117.  
  118. eor_result_list = []
  119.  
  120. for A, B in zip(param_list, key):
  121. eor_result_list.append(A ^ B)
  122.  
  123. for i in range(len):
  124.  
  125. C = self.reverse(eor_result_list[i])
  126. D = eor_result_list[
  127. (
  128. i + 1
  129. )
  130. % len
  131. ]
  132. E = C ^ D
  133.  
  134. F = self.rbit_algorithm(E)
  135. H = (
  136. (
  137. F ^ 0xFFFFFFFF
  138. )
  139. ^ len
  140. ) & 0xFF
  141. eor_result_list[i] = H
  142.  
  143. result = ""
  144. for param in eor_result_list:
  145. result += self.hex_string(param)
  146.  
  147. return {
  148. "X-Gorgon": (
  149. "0404b0d30000"
  150. + result
  151. ),
  152. "X-Khronos": str(unix)
  153. }
  154.  
  155. def rbit_algorithm(self, num):
  156. result = ""
  157. tmp_string = bin(num)[2:]
  158.  
  159. while len(tmp_string) < 8:
  160. tmp_string = (
  161. "0"
  162. + tmp_string
  163. )
  164.  
  165. for i in range(0, 8):
  166. result = (
  167. result
  168. + tmp_string[
  169. 7 - i
  170. ]
  171. )
  172.  
  173. return int(result, 2)
  174.  
  175. def hex_string(self, num):
  176. tmp_string = hex(num)[2:]
  177.  
  178. if len(tmp_string) < 2:
  179. tmp_string = "0" + tmp_string
  180.  
  181. return tmp_string
  182.  
  183. def reverse(self, num):
  184. tmp_string = self.hex_string(num)
  185.  
  186. return int(tmp_string[1:] + tmp_string[:1], 16)
  187.  
  188. class Viewbot:
  189. def __init__(self, aweme_id):
  190. # colorama.init()
  191. cursor.hide()
  192.  
  193. self.aweme_id = aweme_id
  194. self.views = 1
  195. self.errors = 0
  196. self._start = time.time()
  197.  
  198. self.lock = threading.Lock()
  199. self.devices = open('devices.txt', 'r').read().splitlines()
  200.  
  201. def title(self):
  202. while True:
  203. speed = round(
  204. self.views
  205. /
  206. (
  207. int(
  208. time.time()
  209. - self._start
  210. )
  211. + 0.000001
  212. )
  213. , 1
  214. )
  215. os.system(f"title [Fujin] ~ ^&! Tekky#1337 ^| Speed: {speed}/s ^| Fails: {self.errors}" if os.name == "nt" else "")
  216.  
  217. def start(self):
  218. threading.Thread(target=self.title, daemon=True).start()
  219. threading.Thread(target=self.print_loop, daemon=True).start()
  220.  
  221. while True:
  222. if threading.active_count() < 50:
  223. threading.Thread(target=self.send, daemon=True).start()
  224. # time.sleep(0.1)
  225.  
  226.  
  227. def send(self):
  228. try:
  229.  
  230. device = random.choice(self.devices)
  231.  
  232. did = device.split(':')[0]
  233. iid = device.split(':')[1]
  234.  
  235. querystring ={"os_api":"25","device_type":"SM-G973N","ssmix":"a","manifest_version_code":"2021903030","dpi":"320","carrier_region":"IE","uoo":"0","region":"US","carrier_region_v2":"310","app_name":"musical_ly","version_name":"19.3.3","timezone_offset":"7200","ts":int (time .time ()),"ab_version":"19.3.3","residence":"IE","cpu_support64":"false","current_region":"US","ac2":"wifi","ac":"wifi","app_type":"normal","host_abi":"armeabi-v7a","channel":"googleplay","update_version_code":"2021903030","_rticket":int (round ((time .time ()*1000 ))+0 ),"device_platform":"android","iid":iid ,"build_number":"19.3.3","locale":"en","op_region":"IE","version_code":"190303","timezone_name":"Africa/Harare","cdid":"1fc627e2-6956-4df8-9dd8-ed499e2d71a7","openudid":"0e96eaebc0c2e44f","sys_region":"US","device_id":did ,"app_language":"en","resolution":"1600*900","device_brand":"samsung","language":"en","os_version":"7.1.2","aid":"1233","mcc_mnc":"31002"}
  236.  
  237. params = urllib.parse.urlencode(querystring)
  238. payload = f"item_id={self.aweme_id}&sync_origin=false&first_install_time=1653681371&pre_item_playtime=303&follower_status=0&pre_hot_sentence=&pre_item_id=7124331934997597445&share_delta=1&action_time={int(time.time())}&aweme_type=0&follow_status=0"
  239.  
  240. headers = {
  241. "x-ss-stub": str(
  242. hashlib.md5(
  243. payload.encode()
  244. ).hexdigest()
  245. ).upper(),
  246. "accept-encoding": "gzip",
  247. "passport-sdk-version": "19",
  248. "sdk-version": "2",
  249. "x-ss-req-ticket": str(int(round((time.time() * 1000)) + 0)),
  250. "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
  251. "host": "api16-va.tiktokv.com",
  252. "connection": "Keep-Alive",
  253. "user-agent": "okhttp/3.12.1"
  254. }
  255.  
  256. url = "https://api16-va.tiktokv.com/aweme/v1/aweme/stats/?" + params
  257.  
  258. gorgon = Xgorgon(params=params, data=payload, cookies=None).get_value()
  259.  
  260. headers.update(gorgon)
  261. req = requests.post(
  262. url,
  263. data=payload,
  264. headers=headers,
  265. # proxies = {
  266. # "http": f"http://xtekky:tiktik@geo.iproyal.com:12323",
  267. # "https": f"http://xtekky:tiktik@geo.iproyal.com:12323"
  268. # }
  269. ).json()
  270.  
  271. if req["status_code"] == 0:
  272. self.views += 1
  273. # self.print(f"Views sent: {self.views}")
  274.  
  275. else:
  276. print(req)
  277. except:
  278. self.errors += 1
  279.  
  280. def print_loop(self):
  281. while True:
  282. timestamp = datetime.datetime.utcfromtimestamp(int(time.time())).strftime('[%H:%M:%S] ~ ')
  283.  
  284. _len = _xspaces(timestamp + f"Views sent: {self.views}")
  285. # sys.stdout.write("\r" + _len * " " + "\033[91m" + timestamp + f"Views sent: {self.views}" + "\033[0m")
  286. sys.stdout.write("\r" + _len * " " + timestamp + f"Views sent: {self.views}")
  287. sys.stdout.flush()
  288.  
  289. time.sleep(0.5)
  290.  
  291.  
  292. if __name__ == "__main__":
  293. os.system("cls||clear")
  294. print(
  295. Colorate.Vertical(
  296. Colors.red_to_purple,
  297. Center.XCenter(
  298. f"""
  299. ███████╗██╗ ██╗ ██╗██╗███╗ ██╗
  300. ██╔════╝██║ ██║ ██║██║████╗ ██║
  301. █████╗ ██║ ██║ ██║██║██╔██╗ ██║
  302. ██╔══╝ ██║ ██║██ ██║██║██║╚██╗██║
  303. ██║ ╚██████╔╝╚█████╔╝██║██║ ╚████║
  304. ╚═╝ ╚═════╝ ╚════╝ ╚═╝╚═╝ ╚═══╝
  305. by &! Tekky#1337
  306. """
  307. )
  308. ,1
  309. )
  310. + "\n"
  311. )
  312.  
  313. Viewbot("7124332195728198918").start()
  314.  
  315.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement