TikHub/TikHub-API-Python-SDK

TIkTok api cannot be used normally

ysyszheng opened this issue · 1 comments

Hello developers, first of all thank you for providing such a great tool!

When I used the tiktok api provided by this repo to get comments on a certain video, I found that it could not run normally. The returned information was always 解析失败,检查参数/Parse failed, check parameters.

I tried to obtain information other than comments, such as parsing a single tiktok video mentioned in the README demo of this repo, and the returned message was still 解析失败,检查参数/Parse failed, check parameters.

Below is a simplified code I used and its corresponding output, the output of the get_user_info() function is normal, so I think there is no problem with my token.

I would like to know the reason why it is not working properly, such as the API is invalid or there is something wrong with my usage? Any helpful responses are welcome and appreciated :D

Code:

import asyncio
from tikhub import TikTokAPI

if __name__ == '__main__':
    token ="my_token"

    tiktok_api = TikTokAPI(token)

    tiktok_video_url = "https://www.tiktok.com/@cocoeatz/video/7251316303783316778"

    r = None

    r = asyncio.run(tiktok_api.get_user_info())
    print(r)

    r = asyncio.run(tiktok_api.get_tiktok_video_comments(tiktok_video_url))
    print(r)

Outputs:

{my user infomation}
{'status': False, 'platform': 'tiktok', 'endpoint': '/tiktok/video_comments/', 'total_time': None, 'message': '解析失败,检查参数/Parse failed, check parameters', 'video_id': None, 'has_more': None, 'cursor': None, 'next_url': None, 'count': None, 'comments_list': None}

There is the same problem in issue #19