Open
Description
What is msToken? I found it, but it updates every 10 seconds. So when I start the script it returns me not my recommendations. How to fix that?
The buggy code
from TikTokApi import TikTokApi
import asyncio
import os
ms_token = os.environ.get("My msToken", None)
async def trending_videos():
async with TikTokApi() as api:
await api.create_sessions(headless=False, ms_tokens=[ms_token], num_sessions=1, sleep_after=3)
async for video in api.trending.videos(count=30):
print(video)
print(video.as_dict)
if __name__ == "__main__":
asyncio.run(trending_videos())
Desktop:
- OS: Windows 11
- TikTokApi Version 7.0.0