Russell-Newton / TikTokPy

Extract data from TikTok without needing any login information or API keys.
https://pypi.org/project/tiktokapipy/
MIT License
197 stars 25 forks source link

how to get the basic video info LightVideo from user.videos and avoid query other time consuming data #25

Closed Tianqi-Dotes closed 1 year ago

Tianqi-Dotes commented 1 year ago

hi, how can I get the basic video info LightVideo from user.videos and avoid query data in Video. I found comment data easy to throw exceptions and time-consuming. image Maybe I can firstly get the basic video id set of a user and decide what I want next steps. Then query other video details by the video id I have got.

Tianqi-Dotes commented 1 year ago

the basic info like below as an example to exclude info from Video: {"id": 7191561099353918726, "stats": {"digg_count": 1124, "share_count": 9, "comment_count": 67, "play_count": 28400}, "create_time": "2023-01-22T19:30:03+00:00", "desc": "US Vice President Kamala Harris delivered a speech in Florida to mark the 50th anniversary of the landmark #RoevWade ruling, which established a constitutional right to abortion, but was overturned last June #USnews #usvicepresident #kamalaharris ", "diversification_labels": null, "author": "skynews"}

Russell-Newton commented 1 year ago

At the moment, the best option is to use user.videos._light_models. This is hidden from the documentation, but I'll make a better solution when I can in the next couple of days

Russell-Newton commented 1 year ago

Additionally, the comment ValidationError issue has been addressed in v0.1.10.post2

Tianqi-Dotes commented 1 year ago

Hi Russell, Thanx for the reply that is helpful. There are more details I can give. I forget to mention, while I add scroll_down_time to scrape more users' videos, that will lead to high memory. And I also meet the same question https://github.com/Russell-Newton/TikTokPy/issues/16 over 30 secs. Will do more tests on the user video methods.

Tianqi-Dotes commented 1 year ago

this works and in just secs get results. thanks image