Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-media-plugin-spotify

This is a Spotify plugin for ovos-audio and ovos-media. It lets OVOS start playback on Spotify.

NOTE: You also need the companion skill to integrate with voice search.

Install

pip install ovos-media-plugin-spotify

Oauth

You must perform Oauth manually.

After you install the plugin, run ovos-spotify-oauth on the command line and follow the instructions.

$ ovos-spotify-oauth
This script creates the token information needed for running spotify
        with a set of personal developer credentials.

        It requires the user to go to developer.spotify.com and set up a
        developer account, create an "Application" and make sure to whitelist
        "https://127.0.0.1:8888".

        After you have done that enter the information when prompted and follow
        the instructions given.
        
YOUR CLIENT ID: xxxxx
YOUR CLIENT SECRET: xxxxx
Go to the following URL: https://accounts.spotify.com/authorize?client_id=xxx&response_type=code&redirect_uri=https%3A%2F%2F127.0.0.1%3A8888&scope=user-library-read+streaming+playlist-read-private+user-top-read+user-read-playback-state
Enter the URL you were redirected to: https://127.0.0.1:8888/?code=.....
ocp_spotify oauth token saved

Configuration

Edit your mycroft.conf and add the Spotify players you want to expose.

NOTE: If you want to make the OVOS device itself a Spotify player, use spotifyd.

The easiest way to configure this is the ovos-spotify-autoconfigure command.

$ ovos-spotify-autoconfigure
This script will auto configure ALL spotify devices under your mycroft.conf
        
        SPOTIFY PREMIUM is required!
        
        If you have not yet authenticated your spotify account, run 'ovos-spotify-oauth' first!
        
Found device: OpenVoiceOS-TV

mycroft.conf updated!

# Legacy Audio Service:
{'backends': {'spotify-OpenVoiceOS-TV': {'active': True,
                                         'identifier': 'OpenVoiceOS-TV',
                                         'type': 'ovos_spotify'}}}

# ovos-media Service:
{'audio_players': {'spotify-OpenVoiceOS-TV': {'active': True,
                                              'aliases': ['OpenVoiceOS-TV'],
                                              'identifier': 'OpenVoiceOS-TV',
                                              'module': 'ovos-media-audio-plugin-spotify'}}}

ovos-audio

{
  "Audio": {
    "backends": {
      "spotify": {
        "type": "ovos_spotify",
        "identifier": "device_name_in_spotify",
        "active": true
      }
    }
  }
}

ovos-media

WARNING: ovos-media has not been released yet. It is a work in progress.

{
 "media": {
    "audio_players": {
        "desk_speaker": {
            "module": "ovos-media-audio-plugin-spotify",
            
            // this needs to be the name of the device on spotify!
            "identifier": "Mark2",

            // users may request specific handlers in the utterance
            // using these aliases
            "aliases": ["office spotify", "office", "desk", "workstation"],

            // deactivate a plugin by setting to false
            "active": true
        }
    }
}

Python usage

If you do not want to use the companion skill, you can write your own integrations.

s = SpotifyClient()
# pprint(s.query_album("hail and kill by manowar")[1])

from ovos_utils.skills.audioservice import ClassicAudioServiceInterface
from ovos_utils.messagebus import FakeBus

bus = FakeBus()
audio = ClassicAudioServiceInterface(bus)

audio.play("spotify:playlist:37i9dQZF1DX08jcQJXDnEQ")
audio.play(["spotify:track:5P2Ghhv0wFYThHfDQaS0g5",
            "spotify:playlist:37i9dQZF1DX08jcQJXDnEQ"])
time.sleep(5)
audio.pause()
time.sleep(5)

audio.resume()
time.sleep(5)

audio.next()
time.sleep(5)

audio.prev()
time.sleep(5)

print(audio.track_info())
  • ovos-audio: the legacy audio service this plugin integrates with.
  • ovos-media: the media service this plugin integrates with.
  • skill-ovos-spotify: the companion skill for voice search.
  • spotifyd: a Spotify client daemon you can run on the OVOS device itself.

Metadata

Release files for ovos-media-plugin-spotify 0.2.12a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ovos-media-plugin-spotify 0.2.12a1
File Size Uploaded Provenance Actions
ovos_media_plugin_spotify-0.2.12a1.tar.gz 20.3 kB Without provenance Details for ovos_media_plugin_spotify-0.2.12a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ovos-media-plugin-spotify 0.2.12a1
File Interpreter ABI Platform Actions
ovos_media_plugin_spotify-0.2.12a1-py3-none-any.whl Python 3 none any Details for ovos_media_plugin_spotify-0.2.12a1-py3-none-any.whl

Total release size: 37.8 kB

Release files / ovos_media_plugin_spotify-0.2.12a1.tar.gz

Download URL ovos_media_plugin_spotify-0.2.12a1.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
241128c1fe9283f206315d3904ea184b4d8021915e4467685a4166966e84661a
BLAKE2b-256 checksum
How to use checksums
7cb110bdbc96cfed1bc31d0680d457814e397dc88d0c5aa1084349d478529257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / ovos_media_plugin_spotify-0.2.12a1-py3-none-any.whl

Download URL ovos_media_plugin_spotify-0.2.12a1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf8576266943a8e283463b1780791a8a3a98891b4e5b06dc78b9446f0f965bb3
BLAKE2b-256 checksum
How to use checksums
aca7c86c2a3997cbcdd93668832df61b0509dfeaecff5ddcfbf494180b48d6e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for ovos-media-plugin-spotify 0.2.12a1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page