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

[FEATURE_REQUEST] - use async http request to make video.info() unblocking #1199

Open
eysenshi opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@eysenshi
Copy link

eysenshi commented Oct 2, 2024

Is your feature request related to a problem? Please describe.
Can not get batch of video info with concurrent calls, since there is a http request in video.info() which is a blocking call. For example:

api = TikTokApi()

async def video_by_url(url) -> Video:
    video = await api.video(url=url).init()
    await video.info()
    return video

urls = ["https://www.tiktok.com/@dannygrubs/video/7412294496928599342", "https://www.tiktok.com/@dannygrubs/video/7407427078250925354"]

tasks = [video_by_url(video_url) for video_url in urls]
videos = await asyncio.gather(*tasks)

Describe the solution you'd like
It would be great to use a async http library, such as httpx or aiohttp, to make the http call unblocking.

@eysenshi eysenshi changed the title [FEATURE_REQUEST] - Async http request in video.info [FEATURE_REQUEST] - use async http request to make video.info() unblocking Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant