Advertisement
xtekky_

Untitled

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