Open Dr-Yes opened 6 months ago
This is happening because there are not enough checks on the video method to ensure the number of videos returned is at or below the count number. I don't have time to fix this right now, so please feel free to create a PR!
I'm trying to only get 20 videos from a user so I changed the example like so:
`import asyncio import json
from pytok.tiktok import PyTok
async def main(): async with PyTok() as api: user = api.user(username="therock") user_data = await user.info()
if name == "main": asyncio.run(main())`
It prints "Failed to get videos all at once, trying in batches..." and returns 32 videos for this user and 35 for a different one I tried. Is async the problem? edit: can't get the code markdown to work, but I hope it's readable enough. Only thing I changed is add count=20 to videos parameter