We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From the script below, can we only get text/comments from the user?
from TikTokApi import TikTokApi import asyncio import os
video_id = 7331767529976745234 ms_token = os.environ.get("ms_token", None) # set your own ms_token
context_options = { 'viewport' : { 'width': 1280, 'height': 1024 }, 'user_agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' }
async def get_comments(): async with TikTokApi() as api: await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, headless=False) video = api.video(id=video_id) count = 0 async for comment in video.comments(count=100): print(comment) print(comment.as_dict)
if name == "main": asyncio.run(get_comments())
The text was updated successfully, but these errors were encountered:
No branches or pull requests
From the script below, can we only get text/comments from the user?
from TikTokApi import TikTokApi
import asyncio
import os
video_id = 7331767529976745234
ms_token = os.environ.get("ms_token", None) # set your own ms_token
context_options = {
'viewport' : { 'width': 1280, 'height': 1024 },
'user_agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36'
}
async def get_comments():
async with TikTokApi() as api:
await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, headless=False)
video = api.video(id=video_id)
count = 0
async for comment in video.comments(count=100):
print(comment)
print(comment.as_dict)
if name == "main":
asyncio.run(get_comments())
The text was updated successfully, but these errors were encountered: