mirror for docker/* tags

ashthespy 939fc583e7 Help `pkg-config` with explicit paths 4 years ago
audio 1ccf00cfbb Merge branch 'master' into error-source-fix 5 years ago
cache 85c1925f8d Fixes compilation errors 8 years ago
connect 8d08425ef3 Refactor adding context tracks to state 5 years ago
contrib 939fc583e7 Help `pkg-config` with explicit paths 4 years ago
core bf7f54a218 Merge pull request #299 from librespot-org/error-source-fix 5 years ago
docs f61bbd87a8 Change documentation to reflect code behavior 6 years ago
examples 00e89343fb Formatting 6 years ago
metadata c5fcdfd43c Upgrade `protobuf` to `2.0` and use `protoc-rust` to compile proto files 5 years ago
playback 6c4311fe72 Merge pull request #283 from matikij/sdl-backend 5 years ago
protocol 06c6969e25 Switch to `protobuf-codegen-pure` to remove `protoc` dependency 5 years ago
src 37eca2fab3 Update env_logger to 0.6 5 years ago
.dockerignore 0331a7f592 Remove contrib from .dockerignore 5 years ago
.gitignore 12487966b2 Somewhat uniform coding style might help myself to better understand Rust :-) 6 years ago
.travis.yml c22a6d1fa0 Requires 1.30.0 not 1.27.0 apparently. 5 years ago
CONTRIBUTING.md 8e0d75891d [ci skip] Create CONTRIBUTING.md 6 years ago
Cargo.lock 37eca2fab3 Update env_logger to 0.6 5 years ago
Cargo.toml 37eca2fab3 Update env_logger to 0.6 5 years ago
LICENSE a993b60ffa Initial commit. 9 years ago
README.md 2e7c5e9ae1 Bump rust version number. 5 years ago
rustfmt.toml 0d92ac74d1 Add rustfmt.toml 6 years ago

README.md

Build Status Gitter chat

librespot

librespot is an open source client library for Spotify. It enables applications to use Spotify's service, without using the official but closed-source libspotify. Additionally, it will provide extra features which are not available in the official library.

Note: librespot only works with Spotify Premium. This will remain the case for the forseeable future, as we are unlikely to work on implementing the features such as limited skips and adverts that would be required to make librespot compliant with free accounts.

This fork

As the origin by plietar is no longer actively maintained, this organisation and repository have been set up so that the project may be maintained and upgraded in the future.

Documentation

Documentation is currently a work in progress.

There is some brief documentation on how the protocol works in the docs folder, and more general usage and compilation information is available on the wiki.

CONTRIBUTING.md also contains detailed instructions on setting up a development environment, compilation, and contributing guidelines.

If you wish to learn more about how librespot works overall, the best way is to simply read the code, and ask any questions you have in the Gitter chat linked above.

Issues

If you run into a bug when using librespot, please search the existing issues before opening a new one. Chances are, we've encountered it before, and have provided a resolution. If not, please open a new one, and where possible, include the backtrace librespot generates on crashing, along with anything we can use to reproduce the issue, eg. the Spotify URI of the song that caused the crash.

Building

Rust 1.30.0 or later is required to build librespot.

We recently switched to using Rodio for audio playback by default, hene for macOS and Windows, you should just be able to clone and build librespot (with the command below). For linux, you will need to run the additional commands below, depending on your distro.

On debian / ubuntu, the following command will install these dependencies :

sudo apt-get install build-essential libasound2-dev

On Fedora systems, the following command will install these dependencies :

sudo dnf install alsa-lib-devel make gcc

Once you've cloned this repository you can build librespot using cargo.

cargo build --release

Usage

A sample program implementing a headless Spotify Connect receiver is provided. Once you've built librespot, run it using :

target/release/librespot --name DEVICENAME

The above is a minimal example. Here is a more fully fledged one:

target/release/librespot -n "Librespot" -b 320 -c ./cache --enable-volume-normalisation --initial-volume 75 --device-type avr

The above command will create a receiver named Librespot, with bitrate set to 320kbps, initial volume at 75%, with volume normalisation enabled, and the device displayed in the app as an Audio/Video Receiver. A folder named cache will be created/used in the current directory, and be used to cache audio data and credentials.

A full list of runtime options are available here

Contact

Come and hang out on gitter if you need help or want to offer some. https://gitter.im/librespot-org/spotify-connect-resources

Disclaimer

Using this code to connect to Spotify's API is probably forbidden by them. Use at your own risk.

License

Everything in this repository is licensed under the MIT license.

Related Projects

This is a non exhaustive list of projects that either use or have modified librespot. If you'd like to include yours, submit a PR.