You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any news on this?
No replies object is found in the comments object, this is the code im using
from TikTokApi import TikTokApi
import asyncio
import os
video_id = 7248300636498890011
ms_token = os.environ.get("ms_token", None) # set your own ms_token
async def get_comments():
async with TikTokApi() as api:
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
video = api.video(id=video_id)
count = 0
async for comment in video.comments(count=30):
print("Comment:")
print(comment)
print(comment.as_dict)
# Fetch and print replies for the comment
async for reply in comment.replies(count=10): # Adjust count as needed
print(" Reply:")
print(reply)
print(reply.as_dict)
from TikTokApi import TikTokApi
import asyncio
import os
video_id = 7379950165601307905
ms_token = os.environ.get("ms_token", None) # set your own ms_token
async def get_comments():
async with TikTokApi() as api:
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
video = api.video(id=video_id)
api.trending
count = 0
if name == "main":
asyncio.run(get_comments())
The text was updated successfully, but these errors were encountered: