Replies: 1 comment
-
Probably relevant, I'm running this as a local file, not a jupyter notebook. I'm running it via python example.py |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Trying to get this example to work:
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(ms_token=ms_token, async_playwright=True) 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.as_dict)
if name == "main":
asyncio.run(get_comments())
I have installed Playwright, this API, and asyncio. Any suggestions on how to get around this issue? Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions