librespot-spotizerr
Spotizerr's librespot python integration
About The Project
This project is to further add more features for the spotizerr project, forked from librespot-python
Getting Started
Prerequisites
Installation
Stable Version
pip install librespot-spotizerr
Snapshot Version *Not recommended
pip install git+https://github.com/Xoconoch/librespot-spotizerr
Usage
Use Zeroconf for Login (no premium required)
from librespot.zeroconf import ZeroconfServer
import time
import logging
import pathlib
zs = ZeroconfServer.Builder().create()
logging.warning("Transfer playback from desktop client to librespot-spotizerr via Spotify Connect in order to store session")
while True:
time.sleep(1)
if zs._ZeroconfServer__session:
logging.warning(f"Grabbed {zs._ZeroconfServer__session} for {zs._ZeroconfServer__session.username()}")
if pathlib.Path("credentials.json").exists():
logging.warning("Session stored in credentials.json. Now you can Ctrl+C")
break
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 librespot.audio.decoders 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.VERY_HIGH), False, None)
# stream.input_stream.stream().read() to get one byte of the music stream.
Other uses are examples or read this document for detailed specifications.
Debug
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)
Contributing
Pull requests are welcome.
License
Distributed under the GPL yada yada, See LICENSE for more information.
Related Projects
- Librespot (Concept)
- Librespot-Java (Core)
Metadata
Release files for librespot-spotizerr 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| librespot_spotizerr-0.3.0.tar.gz | 116.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| librespot_spotizerr-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 248.2 kB
Release files / librespot_spotizerr-0.3.0.tar.gz
| Download URL | librespot_spotizerr-0.3.0.tar.gz |
|---|---|
| Size | 116.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30a79da64a0382ee92508686e57f6bc8721810bf3e6ec0348adb92fd9b3cdab7
|
|
BLAKE2b-256 checksum How to use checksums |
c5df23902b3798a179e1c6c2e8496c0e2194037509249518b4608bec65b5d677
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2025.
Transparency logRelease files / librespot_spotizerr-0.3.0-py3-none-any.whl
| Download URL | librespot_spotizerr-0.3.0-py3-none-any.whl |
|---|---|
| Size | 131.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc816255b08359dbca7043d3ba8ccec7d95957d05717e9e75af643b4ab66d217
|
|
BLAKE2b-256 checksum How to use checksums |
10961ae978a17e2be6bbb9c25bf3256092c4010cf39a8065bad059f3a6877fc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 13, 2025.
Transparency log