Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix count parameter for hashtag, user, and trending classes #1108

Merged
merged 1 commit into from Feb 9, 2024

Conversation

lysmm203
Copy link
Contributor

There's no issue that pertains to this fix so I'll briefly describe it here. When downloading videos through the hashtag, user, and trending classes by calling the video function, it does not use the count parameter to limit the number of video downloads. For example, given this code snippet:

async def foo():
    async with TikTokApi() as api:
        await api.create_sessions(ms_tokens=[ms_token], num_sessions=1, sleep_after=3, headless=False)
        async for video in api.trending.videos(count=5):
            print(video.id)

asyncio.run(foo())

we would expect 5 ids to be printed. However, since the count values are hard coded in the function, the input count=5 gets overwritten.

@jhl8041
Copy link

jhl8041 commented Feb 9, 2024

@lysmm203
This needs to be fixed.. I was quite confused by this issue. Thank you

@davidteather davidteather changed the base branch from main to v6.2.1 February 9, 2024 15:31
@davidteather davidteather merged commit 04431fb into davidteather:v6.2.1 Feb 9, 2024
davidteather added a commit that referenced this pull request Feb 9, 2024
* remove sponsors

* Fix count parameter for hashtag, user, and trending classes (#1108)

* Fix trending count (#1103)

Co-authored-by: ben.wisnet <ben.wisnet@gmail.com>

* Made author field optional (#1099)

Fixed issue where error is raised for some videos that are missing the "author" field

* bump version

---------

Co-authored-by: lysmm203 <65572921+lysmm203@users.noreply.github.com>
Co-authored-by: Ben3056 <32847329+Ben3056@users.noreply.github.com>
Co-authored-by: ben.wisnet <ben.wisnet@gmail.com>
Co-authored-by: Tristan Lee <lee.tristan.evans@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants