TikTok-Api
TikTok-Api copied to clipboard
[BUG] - Quickstart doesn't work (No trending videos)
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.
maybe related to #880
Same here. We tried the documentent code on Windows and MacOS and it doesnt work.
@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
fixed V6