Russell-Newton / TikTokPy

Extract data from TikTok without needing any login information or API keys.
https://pypi.org/project/tiktokapipy/
MIT License
192 stars 24 forks source link

Unable to fetch video comments #41

Closed RenHong-HC closed 1 year ago

RenHong-HC commented 1 year ago

I want to get the comments of the video, but the data obtained by the following code is empty

from tiktokapipy.api import TikTokAPI
def do_something():
    with TikTokAPI(navigator_type = 'chromium') as api:
        video = api.video("https://www.tiktok.com/@sstowen/video/7232788728538844459")
        comments = video.comments
        comment_text = [comment.text for comment in comments]
        print("Comments: ", comment_text)

do_something()

console print result

A second attempt might work.
  video = api.video("https://www.tiktok.com/@sstowen/video/7232788728538844459")
Comments:  []

I checked the related issues, but I didn't find a suitable answer, I hope to get your help

Russell-Newton commented 1 year ago

Duplicate of #23, #30. I'm planning on working on this issue this week and next. Please follow one of those issues to get updates about collecting comments. I'm closing this as a duplicate.

RenHong-HC commented 1 year ago

ok, thanks for your reply!