Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time, random, requests, json, threading
- from urllib.parse import urlencode
- from utils.gorgon import Xgorgon
- # device = json.load(open('device.json'))
- def get_params(username) -> str:
- # params = {
- # "unique_id": username,
- # "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/Harare",
- # #"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",
- # }
- params = {
- "unique_id": username,
- #"sec_user_id": "MS4wLjABAAAANf1ZtZv9Ie4d7jaIkxDcxOnFO-MKuPJmAF_HIQef46WZsFr3bccw-O-ZdgF4-2w5",
- "address_book_access": "2",
- "from": "0",
- "user_avatar_shrink": "188_188",
- "user_cover_shrink": "750_422",
- "os_api": "25",
- "device_type": "SM-G973N",
- "ssmix": "a",
- "manifest_version_code": "2021901030",
- "dpi": "320",
- "carrier_region": "IE",
- "uoo": "0",
- "region": "US",
- "carrier_region_v2": "310",
- "app_name": "musical_ly",
- "version_name": "19.1.3",
- "timezone_offset": "7200",
- "ts": "1658273727",
- "ab_version": "19.1.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": "2021901030",
- "_rticket": "1658267489496",
- "device_platform": "android",
- "iid": "7121866431746524933",
- "build_number": "19.1.3",
- "locale": "en",
- "op_region": "IE",
- "version_code": "190103",
- "timezone_name": "Africa/Harare",
- "cdid": "09caa359-46d5-493c-80c9-ee59809471f0",
- "openudid": "0e96eaebc0c2e44f",
- "sys_region": "US",
- "device_id": "6888243656290108930",
- "app_language": "en",
- "resolution": "900*1600",
- "device_brand": "samsung",
- "language": "en",
- "os_version": "7.1.2",
- "aid": "1233",
- "mcc_mnc": "31002"
- }
- return urlencode(params, True)
- def get_headers() -> dict:
- headers = {
- "User-Agent": "com.tiktok.tv/110401 (Linux; U; Android 7.1.2; en_US; ASUS_Z01QD; Build/N2G48H;tt-ok/3.10.0.2)",
- "cookie": "sessionid=c559a2c9766683a020c5659a02e0ba3f", #replace pls
- }
- return headers
- def unique_id(username: str) -> dict: #, host: str) -> dict:
- params = get_params(username)
- headers = get_headers()
- # params = 'unique_id=sx&os_api=25&device_type=SM-G973N&ssmix=a&manifest_version_code=2021802150&dpi=320&carrier_region=IE&uoo=0®ion=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'
- # url = (
- # "https://"
- # + "api16-normal-c-useast2a.tiktokv.com"
- # + "/aweme/v1/user/uniqueid/check?"
- # + params
- # )
- url = f"https://api16-normal-c-useast2a.tiktokv.com/aweme/v1/unique/id/check/?" + params
- xg = Xgorgon(params=params, data=None, cookies=None).get_value()
- headers["x-gorgon"] = xg["X-Gorgon"]
- headers["x-khronos"] = xg["X-Khronos"]
- # try:
- # r = requests.get(url, headers=headers, timeout=4)
- # if "is_valid" in r.text:
- # print(r.text)
- # try:
- # with open('valid1.txt', 'a') as f:
- # f.write(host + '\n')
- # except Exception as e:
- # print(e)
- # except:
- # print('Invalid ' + host)
- # pass
- # print(json.dumps(r.json(), indent=4))
- r = requests.get(url, headers=headers)
- print(r.text)
- # for x in range(1):
- # name = "".join(random.choices("abcdefghijklmnopqrstuvwxyz", k=3))
- # threading.Thread(target=unique_id, args=[name]).start()
- # for x in open("valid.txt", "r").read().splitlines():
- # unique_id("xxx",x) # x)
- # # time.sleep(1)
- unique_id("xxx")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement