spotify_handler
¶
Module Contents¶
Classes¶
Spotify operation types. |
|
Handles spotify url music. |
- class spotify_handler.SpotifyHandler¶
Bases:
pipo.player.audio_source.base_handler.BaseHandler
Handles spotify url music.
- name¶
- static __valid_source(source: Iterable[str]) bool ¶
Check whether source is a spotify url.
- handle(source: str) pipo.player.audio_source.source_pair.SourcePair ¶
Check whether handler is able to process source.
- static __format_query(track: pipo.player.audio_source.schemas.spotify.SpotifyTrack) pipo.player.audio_source.source_pair.SourcePair ¶
- static _get_playlist(client: spotipy.Spotify, query: str, fields: Iterable[str], limit: int) list[pipo.player.audio_source.schemas.spotify.SpotifyTrack] ¶
- static _get_album(client: spotipy.Spotify, query: str, limit: int) list[pipo.player.audio_source.schemas.spotify.SpotifyTrack] ¶
- static _get_track(client: spotipy.Spotify, query: str) list[pipo.player.audio_source.schemas.spotify.SpotifyTrack] ¶
-
async static tracks_from_query(query: str, shuffle: bool =
False
) Iterable[pipo.player.audio_source.source_pair.SourcePair] ¶ TODO
asyncio.to_thread is used to avoid blocking asyncio event loop, considering Spotipy library is not CPU nor asyncio friendly.