Mopidy extension for playing music from Spotify
Project description
mopidy-spotify
Mopidy extension for playing music from Spotify.
Status
[!WARNING] Spotify have recently disabled username and password login for playback (#394) and we now use access token login. You no longer need to provide your Spotify account username or password.
Mopidy-Spotify currently has no support for the following:
- Seeking
- Gapless playback
- Volume normalization
- Saving items to My Music (#108) - possible via web API
- Podcasts (#201) - now possible
- Radio (#9) - unavailable?
- Spotify Connect (#14)
Working support for the following features is currently available:
- Playback
- Search
- Playlists (read-only)
- Top lists and Your Music (read-only)
- Lookup by URI
Dependencies
-
A Spotify Premium subscription. Mopidy-Spotify will not work with Spotify Free, just Spotify Premium.
-
Mopidy >= 3.4. The music server that Mopidy-Spotify extends.
-
gst-plugins-spotify, the GStreamer Rust Plugin for Spotify playback, based on librespot. This plugin is not yet available from apt.mopidy.com. It must be either built from source or Debian packages are available for some platforms.
We currently prefer a forked version of this plugin which provides better logging. Details in release notes here.
Verify the GStreamer spotify plugin is correctly installed:
gst-inspect-1.0 spotifyaudiosrc | grep Version | awk '{print $2}'
Installation
Install by running:
sudo python3 -m pip install --break-system-packages mopidy-spotify
Configuration
Before starting Mopidy, you must visit https://mopidy.com/ext/spotify/#authentication to authorize this extension against your Spotify account:
[spotify]
client_id = ... client_id value you got from mopidy.com ...
client_secret = ... client_secret value you got from mopidy.com ...
[!IMPORTANT] Remove any
credentials.jsonfile you may have manually created. You must also do this if you need to reauthorize the extension.
The following configuration values are available:
-
spotify/enabled: If the Spotify extension should be enabled or not. Defaults totrue. -
spotify/client_id: Your Spotify application client id. You must provide this. -
spotify/client_secret: Your Spotify application secret key. You must provide this. -
spotify/bitrate: Audio bitrate in kbps.96,160, or320. Defaults to160. -
spotify/volume_normalization: Whether volume normalization is active or not. Defaults totrue. -
spotify/timeout: Seconds before giving up waiting for search results, etc. Defaults to10. -
spotify/allow_cache: Whether to allow caching. The cache is stored in a "spotify" directory within Mopidy'score/cache_dir. Defaults totrue. -
spotify/cache_size: Maximum cache size in MiB. Set to0for unlimited. Defaults to8192. -
spotify/allow_playlists: Whether or not playlists should be exposed. Defaults totrue. -
spotify/search_album_count: Maximum number of albums returned in search results. Number between 0 and 50. Defaults to 20. -
spotify/search_artist_count: Maximum number of artists returned in search results. Number between 0 and 50. Defaults to 10. -
spotify/search_track_count: Maximum number of tracks returned in search results. Number between 0 and 50. Defaults to 50. -
spotify/username: Deprecated since v5.0.0. Please remove from your configuration file. -
spotify/password: Deprecated since v5.0.0. Please remove from your configuration file.
Project resources
Development
Set up development environment
Clone the repo using, e.g. using gh:
gh repo clone mopidy/mopidy-spotify
Enter the directory, and install dependencies using uv:
cd mopidy-spotify/
uv sync
Running tests
To run all tests and linters in isolated environments, use tox:
tox
To only run tests, use pytest:
pytest
To format the code, use ruff:
ruff format .
To check for lints with ruff, run:
ruff check .
To check for type errors, use pyright:
pyright .
Making a release
To make a release to PyPI, go to the project's GitHub releases page and click the "Draft a new release" button.
In the "choose a tag" dropdown, select the tag you want to release or create a
new tag, e.g. v0.1.0. Add a title, e.g. v0.1.0, and a description of the changes.
Decide if the release is a pre-release (alpha, beta, or release candidate) or should be marked as the latest release, and click "Publish release".
Once the release is created, the release.yml GitHub Action will automatically
build and publish the release to
PyPI.
Credits
- Original author: Stein Magnus Jodal
- Current maintainer: Nick Steel
- Contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mopidy_spotify-5.0.0.tar.gz.
File metadata
- Download URL: mopidy_spotify-5.0.0.tar.gz
- Upload date:
- Size: 51.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8f24bf897f6ac35eb38a87f9884f74a9fcca54fc48c42f6ea45c76239991cc2
|
|
| MD5 |
c3d023c21eda06fde148b752fbe2a0a5
|
|
| BLAKE2b-256 |
91f11ca13cdde6689c810558396d58476706765d5b9c898385f1994eeb967056
|
Provenance
The following attestation bundles were made for mopidy_spotify-5.0.0.tar.gz:
Publisher:
release.yml on mopidy/mopidy-spotify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mopidy_spotify-5.0.0.tar.gz -
Subject digest:
d8f24bf897f6ac35eb38a87f9884f74a9fcca54fc48c42f6ea45c76239991cc2 - Sigstore transparency entry: 1383054847
- Sigstore integration time:
-
Permalink:
mopidy/mopidy-spotify@27fee87b8e4665c28949323e5bd98c4773916bc3 -
Branch / Tag:
refs/tags/v5.0.0 - Owner: https://github.com/mopidy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@27fee87b8e4665c28949323e5bd98c4773916bc3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mopidy_spotify-5.0.0-py3-none-any.whl.
File metadata
- Download URL: mopidy_spotify-5.0.0-py3-none-any.whl
- Upload date:
- Size: 31.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51c3371b46c3076772fcec8277c2a1cb8af791f1eea89459b6d83d73dcce0841
|
|
| MD5 |
978ac01c992885127c634ae313395c82
|
|
| BLAKE2b-256 |
72e03b1c7812e8207edaa70fa81e570ff890c80a8bc9a6e028d3895fbadeb4b5
|
Provenance
The following attestation bundles were made for mopidy_spotify-5.0.0-py3-none-any.whl:
Publisher:
release.yml on mopidy/mopidy-spotify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mopidy_spotify-5.0.0-py3-none-any.whl -
Subject digest:
51c3371b46c3076772fcec8277c2a1cb8af791f1eea89459b6d83d73dcce0841 - Sigstore transparency entry: 1383054859
- Sigstore integration time:
-
Permalink:
mopidy/mopidy-spotify@27fee87b8e4665c28949323e5bd98c4773916bc3 -
Branch / Tag:
refs/tags/v5.0.0 - Owner: https://github.com/mopidy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@27fee87b8e4665c28949323e5bd98c4773916bc3 -
Trigger Event:
release
-
Statement type: