Fix the hostname for tiktok requests

This commit is contained in:
Alexei Ulanov 2022-12-09 19:45:49 +03:00
parent 28c1561b8e
commit 130392fa5c

View file

@ -309,7 +309,7 @@ class Scraper:
print('正在获取TikTok视频数据...')
try:
# 构造访问链接/Construct the access link
api_url = f'https://api.tiktokv.com/aweme/v1/feed/?aweme_id={video_id}&iid=6165993682518218889&device_id={random.randint(10*10*10, 9*10**10)}&aid=1180'
api_url = f'https://api16-normal-c-useast1a.tiktokv.com/aweme/v1/feed/?aweme_id={video_id}&iid=6165993682518218889&device_id={random.randint(10*10*10, 9*10**10)}&aid=1180'
print("正在获取视频数据API: {}".format(api_url))
async with aiohttp.ClientSession() as session:
async with session.get(api_url, headers=self.tiktok_api_headers, proxy=self.proxies, timeout=10) as response: