Skip to content

[INSTALLATION] - Your error here #1229

Open
@NeUra1l

Description

@NeUra1l

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    installation_helpSomeone is having problems installing the api

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions