Closed RenHong-HC closed 1 year ago
There currently isn't a great way to get all 40+ videos. The way that is currently implemented is to increase the scroll_down_time
parameter in the API constructor. Set that to something like 10, and you'll collect more videos. The exact amount isn't deterministic though, unfortunately.
@Russell-Newton Thank you for your reply,I will try this parameter
I think the changes I've been working on with v0.2 might fix this issue. It could be worth checking out:
pip install -U git+https://github.com/Russell-Newton/TikTokPy.git@v0.2-overhaul I removed the scrolling parameters, but it should (fingers crossed) work without any API constructor parameters. You should be able to get away with:
with TikTokAPI() as api:
user = api.user("tiktok")
for video in user.videos:
# do something
This should iterate over all of a user's videos. You can limit this using the video_limit
parameter in api.user
or using the limit method attached to user.videos
(for video in user.videos.limit(30)
).
@RenHong-HC if you would be willing to try out the WIP changes to see if it works, it could be very helpful for solving this issue. The changes work for me, but it's worth checking if it works for you.
@Russell-Newton v0.2 resolved the issue. Thank you!!
Awesome! I'll close this issue once I release v0.2.
This issue should be resolved in the official version 0.2.0 release. I'm closing this issue as resolved.
I have two needs now
The code for the first case is as follows
The video data can be obtained normally, but there are only 30 videos. How can I get all videos?
The code for the second case is as follows
The video data can be obtained normally, but there are only 40+ videos. How can I get all videos?