TikTok-Api icon indicating copy to clipboard operation
TikTok-Api copied to clipboard

[BUG] - Quickstart doesn't work (No trending videos)

Open s2t2 opened this issue 1 year ago • 3 comments

Describe the bug

The suggested quickstart code doesn't work / doesn't produce results. No trending videos?

The buggy code

pip install TikTokApi==5.2.2
python -m playwright install

Preferably the smallest amount of code to reproduce the issue.

from TikTokApi import TikTokApi

# Watch https://www.youtube.com/watch?v=-uCt1x8kINQ for a brief setup tutorial
with TikTokApi() as api:
    for trending_video in api.trending.videos(count=50):
        # Prints the author's username of the trending video.
        print("----------")
        print(type(trending_video))
        print(trending_video.author.username)

Produces no results. No videos to loop through.

Logging doesn't provide any results either:

from TikTokApi import TikTokApi

import logging


# Watch https://www.youtube.com/watch?v=-uCt1x8kINQ for a brief setup tutorial
with TikTokApi(logging_level=logging.INFO) as api:
    for trending_video in api.trending.videos(count=50):
        # Prints the author's username of the trending video.
        print("----------")
        print(type(trending_video))
        print(trending_video.author.username)

Expected behavior

It should work? If the docs say it should.

Desktop (please complete the following information):

  • OS: Mac
  • TikTokApi Version [e.g. 5.2.2]

Other Info

The hashtag example DOES work, so maybe its just something related to trending videos specifically.

s2t2 avatar Aug 05 '22 01:08 s2t2

maybe related to #880

s2t2 avatar Aug 05 '22 01:08 s2t2

Same here. We tried the documentent code on Windows and MacOS and it doesnt work.

WuukiSven avatar Aug 06 '22 13:08 WuukiSven

@davidteather tiktok.com seems to have changed. I'd love to help get this fixed for trending, It seems some proposed solutions are in #906

jareducherek avatar Aug 14 '22 04:08 jareducherek

fixed V6

davidteather avatar Aug 08 '23 22:08 davidteather