mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #325] [Request] An async version of the client that uses aiohttp instead of requests #251
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#251
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @OmLanke on GitHub (Dec 10, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/325
It will be great to have an async version of this library that can be used in asynchronous projects. I needed one for a discord bot and couldn't use the blocking version.
I did manage to make a fork and get it working but it becomes out of date with the main library pretty quickly (shoutout to the devs who are very active). Don't judge my code. It was a edit I did to have it working
@sigma67 commented on GitHub (Dec 12, 2022):
It's nice that you got this working, but I don't see a way to integrate this into the main project right now. Perhaps it's possible to wrap library functionality in async threads to avoid having to maintain a separate version of the library.
@OmLanke commented on GitHub (Dec 22, 2022):
One way would be having the main working in an async version of the client, and the sync client just called methods on the async client using
asyncio.create_task, but this doesn't make any sense even to me.As you said, async threads would be the best option (using
asyncio.to_thread)@sigma67 commented on GitHub (Aug 20, 2023):
Sorry, I'm going to go ahead and close this as Not Planned. None of the other Python music streaming service clients support async (i.e. spotipy, gmusicapi, python-tidal, etc.), and I don't think it's worth the effort to support.
Another consideration is also the likelihood to run into more issues with rate limits, as parallel requests are even more suspicious than sequential ones.