Open Source Spotify Client
This project was developed to make the music streaming service Spotify available on any device.
It is still in the idea stage, so there is a possibility of unintended behavior or major specification changes.
We DO NOT encourage piracy and DO NOT support any form of downloader/recorder designed with the help of this repository and in general anything that goes against the Spotify ToS.
For other guidelines, please see CODE_OF_CONDUCT.md.
Stable Version *still not working.
pip install librespot
Snapshot Version *Recommended
pip install git+https://github.com/kokarare1212/librespot-python
from librespot.core import Session
session = Session.Builder() \
.user_pass("Username", "Password") \
.create()
aceess_token = session.tokens().get("playlist-read")
*Currently, music streaming is supported, but it may cause unintended behavior.
from librespot.core import Session
from librespot.metadata import TrackId
from librespot.player.codecs import AudioQuality, VorbisOnlyAudioQuality
session = Session.Builder() \
.user_pass("Username", "Password") \
.create()
track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.AudioQuality.VERY_HIGH), False, None)
# stream.input_stream.stream().read() to get one byte of the music stream.
# ex: 1 (If there is no more voice data, -1 is received as the result.)
Please read this document for detailed specifications.
To display the debug information, you need to inject the following code at the top of the code.
import logging
logging.basicConfig(level=logging.DEBUG)
Please read ROADMAP.md.
Pull requests are welcome.
Distributed under the Apache-2.0 License. See LICENSE.txt for more information.
- Librespot (Concept)
- Librespot-Java (Core)
Coming soon