Open Source Spotify Client
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
碧舞すみほ eddbe1d4a9
Merge pull request #197 from kokarare1212/dependabot/pip/requests-2.31.0
Bump requests from 2.30.0 to 2.31.0
3 days ago
.github Update issue templates 2 years ago
dev Release 0.0.1 1 year ago
docs Release 0.0.1 1 year ago
examples #155 Update example(s) 8 months ago
img [ImgBot] Optimize images 2 years ago
librespot #195 Add stored function 2 weeks ago
librespot_player Separate package 1 year ago
proto #135 Add ClientToken support 11 months ago
.deepsource.toml Add .deepsource.toml 2 years ago
.gitignore Add player state 2 years ago Create 2 years ago
LICENSE.txt Add LICENSE.txt 2 years ago Fix minor typo 1 year ago Restyled by prettier-markdown 2 years ago
requirements.txt Merge pull request #197 from kokarare1212/dependabot/pip/requests-2.31.0 3 days ago Bump version 2 weeks ago
sider.yml Restyled by prettier-yaml 2 years ago

License Stars Forks DeepSource


Open Source Spotify Client

About The Project

This project was developed to make the music streaming service Spotify available on any device.


This repository has been completely rewritten from the transplant.
There may be some functions that are not implemented yet.
If so, please feel free to open an issue.


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

Getting Started



Stable Version

pip install librespot

Snapshot Version *Recommended

pip install git+


Use Zeroconf for Login

from librespot.zeroconf import ZeroconfServer

zeroconf = ZeroconfServer.Builder().create()

Get Spotify's OAuth token

from librespot.core import Session

session = Session.Builder() \
    .user_pass("Username", "Password") \

access_token = session.tokens().get("playlist-read")

Get Music Stream

*Currently, music streaming is supported, but it may cause unintended behavior.

from librespot.core import Session
from librespot.metadata import TrackId
from import AudioQuality, VorbisOnlyAudioQuality

session = Session.Builder() \
    .user_pass("Username", "Password") \

track_id = TrackId.from_uri("spotify:track:xxxxxxxxxxxxxxxxxxxxxx")
stream = session.content_feeder().load(track_id, VorbisOnlyAudioQuality(AudioQuality.VERY_HIGH), False, None)
# to get one byte of the music stream.

Other uses are examples or 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



Pull requests are welcome.


Distributed under the Apache-2.0 License. See LICENSE.txt for more information.

Special thanks