1.6 KiB
1.6 KiB
Contributing
What this library is
- A headless Spotify client, allowing you to authenticate and retrieve a decrypted audio stream for any track.
- Not a standalone audio player: the provided stream must be piped to another application (like
ffplay) or handled by a server to be played.
Environment setup
Prerequisites
- Python 3.10+
Install runtime packages
pip install -r requirements.txt
Install protoc
This step is only needed if you're changing any
.protoserialization schema files, which will subsequently require using the protoc compiler to generate updated versions of the*_pb2.pyPython stubs that implement serialization/deserialization for those schemas.
- Go to the protobuf release matching the version pinned in
requirements.txt. - Download and install the
protoc-*.zipfile meant for your platform.
After modifying the .proto files you need to, make sure to follow these steps to regenerate the Python stubs.
Protocol buffer generation
These steps are only necessary after changing
.protofiles.
-
From the repository root, conveniently recompile all
.protoschema files with this command:find proto -name "*.proto" | xargs protoc -I=proto --python_out=librespot/proto -
Alternatively, to recompile a single file (e.g.
proto/metadata.proto), run:protoc -I=proto --python_out=librespot/proto proto/metadata.proto -
Commit both the source
.protoand the regenerated Python output together so they can be compared easily.