davidteather / TikTok-Api

The Unofficial TikTok API Wrapper In Python
https://davidteather.github.io/TikTok-Api
MIT License
4.84k stars 973 forks source link

trending = api.trending just shows videos from the User. "TikTok #1003

Closed TheZaind closed 1 year ago

TheZaind commented 1 year ago

When i want to get shown the now trending videos, i just get videos from the official TikTok account. Why?

My code: `from TikTokApi import TikTokApi

api = TikTokApi()

trending = api.trending(count=10)

for video in trending:

  username = video["author"]["uniqueId"]

  title = video["desc"]

  likes = video["stats"]["diggCount"]

  print(f"Username: {username}")
  print(f"Title: {title}")
  print(f"Likes: {likes}")
  print()

`

The output:

`Username: tiktok Title: Challenge the Game discussed mental health, equality and love for the game! Celebrate all women in sports using #HerStory Likes: 107000

Username: tiktok Title: Check out our new tutorial on going LIVE! Likes: 334000

Username: tiktok Title: You can now ask and answer any questions on LIVE with the new Q&A feature. Check it out now! Likes: 131900

Username: tiktok Title: 🚨New feature alert!🚨more #Duet layouts are now available. Try them out now! Likes: 528900

Username: tiktok Title: Now Introducing: STITCH! Make the ultimate collab with your fav creators 🎬 Likes: 519800

Username: tiktok Title: Challenge the Game discussed mental health, equality and love for the game! Celebrate all women in sports using #HerStory Likes: 107000

Username: tiktok Title: Check out our new tutorial on going LIVE! Likes: 334000

Username: tiktok Title: You can now ask and answer any questions on LIVE with the new Q&A feature. Check it out now! Likes: 131900

Username: tiktok Title: 🚨New feature alert!🚨more #Duet layouts are now available. Try them out now! Likes: 528900

Username: tiktok Title: Now Introducing: STITCH! Make the ultimate collab with your fav creators 🎬 Likes: 519800

Process finished with exit code 0`

Anyone the same issue? What am i doing wrong?

ryanbbrown commented 1 year ago

What version of TikTokApi do you have? Your code didn't work for me, I got TypeError: Trending() takes no arguments.

davidteather commented 1 year ago

Should be fixed in V6