Advertisement
xtekky_

Untitled

Jul 22nd, 2022
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.68 KB | None | 0 0
  1. import time, random, requests, json, threading
  2. from urllib.parse import urlencode
  3. from utils.gorgon import Xgorgon
  4.  
  5. # device = json.load(open('device.json'))
  6.  
  7.  
  8.  
  9. def get_params(username) -> str:
  10. # params = {
  11. # "unique_id": username,
  12. # "os_api": "25",
  13. # "device_type": "SM-G973N",
  14. # #"ssmix": "a",
  15. # #"manifest_version_code": "2021802150",
  16. # #"dpi": "320",
  17. # #"carrier_region": "IE",
  18. # #"uoo": "0",
  19. # #"region": "US",
  20. # #"carrier_region_v2": "310",
  21. # "app_name": "musical_ly",
  22. # "version_name": "18.2.15",
  23. # "timezone_offset": "7200",
  24. # #"ts": "1658103411",
  25. # "ab_version": "18.2.15",
  26. # #"cpu_support64": "false",
  27. # #"ac2": "wifi",
  28. # #"ac": "wifi",
  29. # #"app_type": "normal",
  30. # #"host_abi": "armeabi-v7a",
  31. # #"channel": "beta",
  32. # #"update_version_code": "2021802150",
  33. # #"_rticket": "1658103411673",
  34. # #"device_platform": "android",
  35. # "iid": "7121471512800151301",
  36. # #"build_number": "18.2.15",
  37. # #"locale": "en",
  38. # #"op_region": "IE",
  39. # "version_code": "180215",
  40. # #"timezone_name": "Africa/Harare",
  41. # #"cdid": "3ef63beb-d67f-478a-9cb8-5df0dc98ff2d",
  42. # #"openudid": "0e96eaebc0c2e44f",
  43. # "device_id": "6888243656290108930",
  44. # #"sys_region": "US",
  45. # #"app_language": "en",
  46. # #"resolution": "900*1600",
  47. # #"device_brand": "samsung",
  48. # #"language": "en",
  49. # "os_version": "7.1.2",
  50. # "aid": "1233",
  51. # }
  52.  
  53. params = {
  54. "unique_id": username,
  55. #"sec_user_id": "MS4wLjABAAAANf1ZtZv9Ie4d7jaIkxDcxOnFO-MKuPJmAF_HIQef46WZsFr3bccw-O-ZdgF4-2w5",
  56. "address_book_access": "2",
  57. "from": "0",
  58. "user_avatar_shrink": "188_188",
  59. "user_cover_shrink": "750_422",
  60. "os_api": "25",
  61. "device_type": "SM-G973N",
  62. "ssmix": "a",
  63. "manifest_version_code": "2021901030",
  64. "dpi": "320",
  65. "carrier_region": "IE",
  66. "uoo": "0",
  67. "region": "US",
  68. "carrier_region_v2": "310",
  69. "app_name": "musical_ly",
  70. "version_name": "19.1.3",
  71. "timezone_offset": "7200",
  72. "ts": "1658273727",
  73. "ab_version": "19.1.3",
  74. "residence": "IE",
  75. "cpu_support64": "false",
  76. "current_region": "US",
  77. "ac2": "wifi",
  78. "ac": "wifi",
  79. "app_type": "normal",
  80. "host_abi": "armeabi-v7a",
  81. "channel": "googleplay",
  82. "update_version_code": "2021901030",
  83. "_rticket": "1658267489496",
  84. "device_platform": "android",
  85. "iid": "7121866431746524933",
  86. "build_number": "19.1.3",
  87. "locale": "en",
  88. "op_region": "IE",
  89. "version_code": "190103",
  90. "timezone_name": "Africa/Harare",
  91. "cdid": "09caa359-46d5-493c-80c9-ee59809471f0",
  92. "openudid": "0e96eaebc0c2e44f",
  93. "sys_region": "US",
  94. "device_id": "6888243656290108930",
  95. "app_language": "en",
  96. "resolution": "900*1600",
  97. "device_brand": "samsung",
  98. "language": "en",
  99. "os_version": "7.1.2",
  100. "aid": "1233",
  101. "mcc_mnc": "31002"
  102. }
  103.  
  104. return urlencode(params, True)
  105.  
  106.  
  107. def get_headers() -> dict:
  108.  
  109. headers = {
  110. "User-Agent": "com.tiktok.tv/110401 (Linux; U; Android 7.1.2; en_US; ASUS_Z01QD; Build/N2G48H;tt-ok/3.10.0.2)",
  111. "cookie": "sessionid=c559a2c9766683a020c5659a02e0ba3f", #replace pls
  112. }
  113.  
  114. return headers
  115.  
  116.  
  117. def unique_id(username: str) -> dict: #, host: str) -> dict:
  118.  
  119. params = get_params(username)
  120. headers = get_headers()
  121. # params = 'unique_id=sx&os_api=25&device_type=SM-G973N&ssmix=a&manifest_version_code=2021802150&dpi=320&carrier_region=IE&uoo=0&region=US&carrier_region_v2=310&app_name=musical_ly&version_name=18.2.15&timezone_offset=7200&ts=1658103411&ab_version=18.2.15&cpu_support64=false&ac2=wifi&ac=wifi&app_type=normal&host_abi=armeabi-v7a&channel=beta&update_version_code=2021802150&_rticket=1658103411673&device_platform=android&iid=7121471512800151301&build_number=18.2.15&locale=en&op_region=IE&version_code=180215&timezone_name=Africa%2FHarare&cdid=3ef63beb-d67f-478a-9cb8-5df0dc98ff2d&openudid=0e96eaebc0c2e44f&device_id=6888243656290108930&sys_region=US&app_language=en&resolution=900*1600&device_brand=samsung&language=en&os_version=7.1.2&aid=1233'
  122.  
  123. # url = (
  124. # "https://"
  125. # + "api16-normal-c-useast2a.tiktokv.com"
  126. # + "/aweme/v1/user/uniqueid/check?"
  127. # + params
  128. # )
  129.  
  130. url = f"https://api16-normal-c-useast2a.tiktokv.com/aweme/v1/unique/id/check/?" + params
  131.  
  132. xg = Xgorgon(params=params, data=None, cookies=None).get_value()
  133.  
  134. headers["x-gorgon"] = xg["X-Gorgon"]
  135. headers["x-khronos"] = xg["X-Khronos"]
  136.  
  137. # try:
  138. # r = requests.get(url, headers=headers, timeout=4)
  139. # if "is_valid" in r.text:
  140.  
  141. # print(r.text)
  142. # try:
  143. # with open('valid1.txt', 'a') as f:
  144. # f.write(host + '\n')
  145. # except Exception as e:
  146. # print(e)
  147. # except:
  148. # print('Invalid ' + host)
  149. # pass
  150.  
  151. # print(json.dumps(r.json(), indent=4))
  152.  
  153. r = requests.get(url, headers=headers)
  154. print(r.text)
  155.  
  156. # for x in range(1):
  157. # name = "".join(random.choices("abcdefghijklmnopqrstuvwxyz", k=3))
  158.  
  159. # threading.Thread(target=unique_id, args=[name]).start()
  160.  
  161. # for x in open("valid.txt", "r").read().splitlines():
  162. # unique_id("xxx",x) # x)
  163. # # time.sleep(1)
  164. unique_id("xxx")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement