From 1518b479890aa7de141f1604221a14d017c128c5 Mon Sep 17 00:00:00 2001 From: Evil0ctal Date: Thu, 22 Dec 2022 12:26:23 -0800 Subject: [PATCH] Fix Douyin API response empty data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pls check the follow issues from other repository: - https://github.com/Johnserf-Seed/TikTokDownload/issues/269 - https://github.com/Evil0ctal/Douyin_TikTok_Download_API/issues/127 --- bilix/api/douyin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bilix/api/douyin.py b/bilix/api/douyin.py index 5f7e3fa6..b1ff6aca 100644 --- a/bilix/api/douyin.py +++ b/bilix/api/douyin.py @@ -38,9 +38,9 @@ async def get_video_info(client: httpx.AsyncClient, url: str) -> VideoInfo: key = key.groups()[0] else: key = re.search(r"modal_id=(\d+)", url).groups()[0] - res = await req_retry(client, f'https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids={key}') + res = await req_retry(client, f'https://www.iesdouyin.com/aweme/v1/web/aweme/detail/?aweme_id={key}') data = json.loads(res.text) - data = data['item_list'][0] + data = data['aweme_detail'] # 视频标题 title = legal_title(data['desc']) # 视频作者昵称