Open Source Spotify Client
Go to file
碧舞すみほ 5765526b9d
Merge pull request #231 from kokarare1212/dependabot/pip/zeroconf-0.112.0
Bump zeroconf from 0.108.0 to 0.112.0
2023-09-20 10:22:35 +09:00
.github Update issue templates 2021-09-12 19:11:24 +09:00
dev Release 0.0.1 2022-02-09 20:55:27 +09:00
docs Release 0.0.1 2022-02-09 20:55:27 +09:00
examples #155 Update example(s) 2022-10-07 18:52:08 +09:00
img [ImgBot] Optimize images 2021-07-20 09:17:00 +00:00
librespot Restyled by yapf 2023-09-05 09:21:40 +02:00
librespot_player Separate package 2022-02-09 07:52:14 +09:00
proto #135 Add ClientToken support 2022-06-28 20:55:10 +09:00
.deepsource.toml Add .deepsource.toml 2021-04-09 23:15:34 +00:00
.gitignore Add player state 2021-02-25 18:22:28 +09:00 Create 2021-04-06 07:11:20 +09:00
LICENSE.txt Add LICENSE.txt 2021-05-15 09:04:41 +09:00 Fix minor typo 2022-02-15 19:46:40 +01:00 Restyled by prettier-markdown 2021-05-22 01:26:37 +00:00
requirements.txt Bump zeroconf from 0.108.0 to 0.112.0 2023-09-15 12:31:05 +00:00 Bump version 2023-05-17 07:00:11 +09:00
sider.yml Restyled by prettier-yaml 2021-04-09 23:04:49 +00:00

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