Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
1.7 kB
1
Indexable
Never
params = f"aweme_id={video_id}&origin_type=web&request_source=0&os_api=25&device_type=SM-N975F&ssmix=a&manifest_version_code=2021807050&dpi=300&carrier_region=UA&uoo=1&region=UA&app_name=musical_ly&version_name=18.7.5&timezone_offset=10800&ts=1663238081&ab_version=18.7.5&residence=UA&cpu_support64=true&current_region=UA&ac2=wifi&ac=wifi&app_type=normal&host_abi=armeabi-v7a&channel=googleplay&update_version_code=2021807050&_rticket=1663238081866&device_platform=android&iid=7143547131965753094&build_number=18.7.5&locale=ua-UA&op_region=UA&version_code=180705&timezone_name=Europe%2FMoscow&cdid=197d29aa-33b4-4169-b112-dc80824bac8b&device_id=7143538362753107461&sys_region=UA&app_language=ua&resolution=900*1600&device_brand=samsung&language=ua&os_version=7.1.2&aid=1233&mcc_mnc=250250"
            
sign = signature(params = params, data = "", cookies = "").get_value()
            x_gorgon, x_khronos = sign["X-Gorgon"], sign["X-Khronos"]
            url = f'https://api16-va.tiktokv.com/aweme/v1/aweme/detail/?' + params
            headers = { "user-agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 YaBrowser/21.2.2.102 Yowser/2.5 Safari/537.36", 'x-gorgon': x_gorgon, 'x-khronos': x_khronos}
            
proxies = {
    "https://": "http://gbesd4:sfdvd@45.147.183.127:8000",
}

response = httpx.get(url, headers = { "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36", 'x-gorgon': x_gorgon, 'x-khronos': x_khronos, })

response = response.json()

link = response['aweme_detail']['video']['bit_rate'][0]['play_addr']['url_list'][0]