Code Monkey home page Code Monkey logo

spotify-skill's Introduction

Play Spotify

Listen to music from your Spotify Premium music account.

Spotify has disabled the API access for the skill, you will need to create your own. Instructions below.

To use this skill currently you will need to create your own application using The Spotify developer dashboard due to Spotify policy (see Spotify Authentication reason for some details). Detailed instructions are available below under Personal Access Token.

Listen to music from your Spotify Premium music account

About

Stream your favorite music from the popular Spotify music service. Spotify Premium users can search and play tracks from their own playlists or the huge Spotify music library.

You can also control your Mycroft device using the Spotify Connect system. So play DJ on your phone while listening on Mycroft!

This skill doesn't do any playback

This skill works with the Spotify Connect protocol to interact with Spotify devices, but doesn't perform any playback itself. If you want playback on the hosting Mycroft device, you'll need to set up a player yourself.

For Picroft users, raspotify is a good choice.

Install it and then make changes to /etc/default/raspotify as follows

  • It is recommended to set the DEVICE_NAME to the name of the Mycroft unit (as registered at home.mycroft.ai) for automatic identification:

`DEVICE_NAME=""

  • set your Spotify username and password under OPTIONS

OPTIONS="--username <My Username> --password <My Password>"

You make sound work with raspotify you may need to edit /lib/systemd/system/raspotify.service and there change User and Group from raspotifyto pi.

For desktop users the official spotify player works well.

The exception to this is the Mark-1 which is shipped with a spotify player library.

Authorization:

This Skill uses two different methods of authentication. Both need to be filled in correctly for the Skill to function correctly.

Personal Access Token

Creating access token

From the Spotify developer dashboard

  1. Click "CREATE AN APP"
  2. Fill out the create application form
  3. Click on the new app and choose EDIT SETTINGS
  4. Under Redirect URIs add https://localhost:8888

More info can be found here.

The config will by default be stored in the XDG_CONFIG directory, which is often ~/.config, so by default the generated files are found in ~/.config/spotipy/. If you wish to use another directory you can set the environment variable SPOTIFY_SKILL_CREDS_DIR to the directory where you'd like to store the config. This is useful when running in docker for example.

Install the beta version

Install the most recent version of this skill by telling mycroft:

"install the beta version of the spotify skill"
Connecting spotify skill

General Setup

After installing mycroft-spotify, from the mycroft-core folder run the auth.py script in the mycroft-spotify folder

source venv-activate.sh
python /opt/mycroft/skills/mycroft-spotify.forslund/auth.py

The script will try to guide you through connecting a developer account to the skill and store the credentials locally.

Mark-1

The Mark-1 has a separate service user for Mycroft so the commands needed to run the auth script is as follows:

sudo su mycroft
source /opt/venvs/mycroft-core/bin/activate
python /opt/mycroft/skills/mycroft-spotify.forslund/auth.py

Username and password to authenticate a Mycroft device

In addition to account details, Mycroft needs to be authorized as a device for Spotify. To do this, we use your username and password for Spotify. These must be entered as well, or you will receive an error message like:

I couldn't find any Spotify devices. This skill requires a Spotify Premium account to work properly.

when you try to use the Skill on a Mycroft device.

If you log in to Spotify using Facebook, your password will be your Facebook password, but your Spotify device username. You can get your Spotify device username here.

NOTE: You MUST have a Premium Spotify account to use this Skill. It will NOT work with a free Spotify account.

Examples

  • "What Spotify devices are available?"
  • "Play discover weekly"
  • "Play Hello Nasty on Spotify"
  • "Play something by Covenant"
  • "Play the album Hello Nasty on Spotify"
  • "Play my liked songs"

Commands

Playing music:

  • "Play something by Covenant" - Will queue songs by Covenant
  • "Play Background" - Will play either your playlist named "Background" or the first song result
  • "Play Hello Nasty on Spotify" - Will play first song result matching the query

Controls:

  • "Play the next/previous song" - Will skip the track either forward or backwards, respectively
  • "Stop/Pause the music" - Will pause the current track
  • "Turn on/off spotify shuffle" - Will enable/disable shuffling on the current song queue

Misc:

  • "What Spotify devices are available?" - Will list currently available Spotify devices

Credits

@forslund The Mycroft devs

Category

Music

Tags

#spotify #music

Spotify Authentication reason

Spotify disabled my API access for the skill in August 2020, it was violating their Terms of Service by enabling voice control. I must have missed this back in 2017 when I created the skill. With some luck I can convince Spotify that since the skill is totally non-commercial and open source we may have a single API key for the skill.

spotify-skill's People

Contributors

augray avatar bnolet avatar davidwagnerkc avatar devs-mycroft avatar dvdvgt avatar forslund avatar kathyreid avatar krisgesling avatar lawruble13 avatar luke5sky avatar mrturnit avatar osheroff avatar penrods avatar pmulh avatar ragrag avatar thelastproject avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotify-skill's Issues

If multiple Mycroft Devices have the `mycroft-spotify` Skill installed, Mycroft does not know which Device to stream to

Description of Issue in object-deviation format

If a user has more than one Mycroft device with the mycroft-spotify Skill installed, Mycroft does not know which device to stream to. From observation, it appears Mycroft will stream music to the first device on which the Skill was installed.

I'm not sure what the "expected" behaviour should be here - it's an edge case, because it's unlikely that many users will have > 1 Mycroft device installed AND have mycroft-spotify installed on all devices.

Thoughts on resolution

This is likely due to the way that the Spotify API handles devices.

Suggested resolution:

  • Use skill-settings to have the user define an order of precedence if they have multiple Mycroft devices installed. The mycroft-spotify Skill would then use the order of precedence to stream to the first available Mycroft device.

  • Use voice conversational context to get the user to specify which Mycroft device the audio should be streamed to prior to buffering and playback.

Error running update_skill on mycroft-spotify: MergeConflict

I have a Mark 1 which I keep up-to-date. The current state of the machine is:

$ dpkg -l | grep mycroft
ii  mycroft-core          19.2.4   armhf    mycroft-core
ii  mycroft-mark-1        19.2.4   armhf    A metapackage for the Mycroft Mark-1 device
ii  mycroft-wifi-setup    0.2.7    armhf    mycroft-wifi-setup and mycroft-admin-service

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:        8.0
Codename:       jessie

$ uname -a
Linux mark_1 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l GNU/Linux

Today msm update was unhappy with the Spotify skill

$ msm update
INFO - Nothing new for mycroft-spelling
INFO - Nothing new for mycroft-joke
INFO - Nothing new for mycroft-speak
INFO - Nothing new for mycroft-audio-record
INFO - Nothing new for skill-wolfram-alpha
INFO - Nothing new for mycroft-hello-world
INFO - Nothing new for mycroft-naptime
INFO - Nothing new for fallback-wolfram-alpha
INFO - Nothing new for mycroft-singing
INFO - Nothing new for mycroft-pandora
INFO - Nothing new for mycroft-stop
INFO - Nothing new for mycroft-volume
ERROR - Error running update_skill on mycroft-spotify: MergeConflict
INFO - Nothing new for mycroft-date-time
INFO - Nothing new for mycroft-npr-news
INFO - Nothing new for mycroft-fallback-duck-duck-go
INFO - Nothing new for mycroft-stock
INFO - Nothing new for mycroft-mark-1
INFO - Nothing new for mycroft-timer
INFO - Nothing new for fallback-query
INFO - Nothing new for pianobar-skill
INFO - Nothing new for mycroft-support-helper
INFO - Nothing new for mycroft-configuration
INFO - Nothing new for fallback-unknown
INFO - Nothing new for mycroft-mark-1-demo
INFO - Nothing new for mycroft-pairing
INFO - Nothing new for mycroft-ip
INFO - Nothing new for mycroft-version-checker
INFO - Nothing new for skill-media
INFO - Nothing new for mycroft-installer
INFO - Nothing new for fallback-aiml
INFO - Nothing new for mycroft-wiki
INFO - Nothing new for mycroft-reminder
INFO - Nothing new for mycroft-alarm
INFO - Nothing new for mycroft-personal
INFO - Nothing new for skill-desktop-launcher
INFO - Nothing new for mycroft-weather
INFO - Nothing new for mycroft-playback-control

And more details:

$ cd /opt/mycroft/skills/mycroft-spotify.forslund/
$ git status
On branch 19.02
Your branch and 'origin/19.02' have diverged,
and have 1 and 21 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean

$ git log | head
commit cf9834bca03291d6dd55f4f6250db67ec53d6307
Author: Steve <[email protected]>
Date:   Wed Feb 20 21:45:10 2019 +0000

    Revamp Spotify scoring

    The CommonPlay scoring scheme is a self-reported confidence.  The
    Spotify skill was returning EXACT often, which violates the
    guidelines.  Now it returns either TITLE or MULTI_KEY unless the
    phrase "on spotify" was included in the request -- in which case
    it will reply with EXACT.

unable to find package raspotify

got an error on install so I tried to run apt-get manually

pi@picroft:~/skills/spotify-skill $ sudo apt-get install -yq raspotify -o DPkg::Options::=--force-confdef
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package raspotify

Mac client must connect to Raspotify before Mycroft skill sees it

I have installed Raspotify and the Mycroft Spotify Skill and I have them connecting to my Premium Spotify account and playing through Raspotify on the same machine - with one catch.

On a fresh startup when I ask Mycroft to play something from Spotify, it can’t find any devices, saying " Spotify couldn’t start playback. I couldn’t find any Spotify devices".

ps -ef | grep reaspot shows /usr/bin/librespot is running, but for some reason the skill can’t find it.

However, If I then launch the Spotify app on my Mac and go to Settings -> Open Devices Menu -> and click the device that shows called “raspotify” it somehow “pokes” Raspotify because immediately re-issuing the same voice command to Mycroft works! I don’t even have to start a stream playing from my Mac first. Just clicking the device on the Mac client seems to make Raspotify visible to Mycroft on the Rasperry Pi both are running on.

Has anyone seen this behavior before? Does anyone have any idea what might be going on?

BTW I assume I have to use Raspotify and can’t just have the skill stream directly the way, say, the news skill does? If that’s possible I can’t figure out how to make that simpler setup work either.

Add a way to play liked songs

Is it possible to add command to play songs that I liked on Spotify? When I say play liked songs or play favorite songs, it plays other people's random playlists that are named like that.

Skill fails without feedback

Often when a command fails there is no feedback why it fails, mycroft does not respond and just stays silent, also the logs do not provide any reason why the skill command has failed.

Increase the flexibility of artist regex

I had a hard time getting this skill to play music by a requested artist. Some things I tried:
"Play music by <artist> on Spotify"
"Play songs by <artist> on Spotify"
"Play <artist> on Spotify"

It would be helpful if more standard variations were supported for playing music by specific artists.

Music stops when wake word is triggered

Loving the skill so far! But on annoying thing I've noticed is that the music stops when you say the wake work 'Hey Mycroft'.

Appreciate your work man 👍

play most recent episode of a podcast

Forgive me if this is possible, but I'd like to be able to play the most recent episode of a podcast.

For example if I ask "play ron burgundy podcast", it will start to play a seemingly random episode, and I can not figure out how to ask for a specific one, or the most recent one.

Stopping music by pressing button casues error for about 10 mins after

Hi, I don't have any error logs for this as I am new to Mycroft however I find that if I successfully play a song and decide to stop it (not sure how I am supposed to do that) I press the button on Mark 1 and he stops, but then for about 10 mins after if I try and do anything else with Spotify he says an error has occurred. I can try and work with you to get more info, but maybe this is easy to reproduce?

Plays over Connect, but not locally

I can't figure out if I'm being a complete newb or misunderstanding the purpose of this Skill?

I can use it to play/control Spotify on another device, but it won't stream music directly through the Mycroft.

If I ask it to list all Spotify devices, it will list my PC, or None (depending if the PC has Spotify open or not). I'd like to stream Spotify directly through my Picroft, am I missing a trick here?

Thanks

Specific Song Request

I can't get it to work with specific song titles. For example:
"Hey Mycroft, play the Immigrant Song by Led Zeppelin on Spotify"

Current playing track info

Provide information of current playing track

"What's playing?"
"what are we listening to?"
"what track/song is this?"

Errors on resuming after 'stop' command

To reproduce:

  1. Play song
  2. "Stop"
  3. "Play"
05:40:12.160 - SpotifySkill - INFO - Resume Spotify
05:40:12.170 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.spotify.com:443
05:40:12.240 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443
05:40:12.713 - urllib3.connectionpool - DEBUG - https://api.spotify.com:443 "GET /v1/me/player/currently-playing HTTP/1.1" 200 None
05:40:12.726 - SpotifySkill - INFO - spotify_play: {'name': 'M1-Blue', 'is_restricted': False, 'type': 'Speaker', 'id': '87ae72b4a96cceadc3ae104587a18a690cd8e440', 'is_active': True, 'volume_percent': 80, 'is_private_session': False}
05:40:12.741 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.spotify.com:443
05:40:13.293 - urllib3.connectionpool - DEBUG - https://api.spotify.com:443 "PUT /v1/me/player/play?device_id=%7B'name':%20'M1-Blue',%20'is_restricted':%20False,%20'type':%20'Speaker',%20'id':%20'87ae72b4a96cceadc3ae104587a18a690cd8e440',%20'is_active':%20True,%20'volume_percent':%2080,%20'is_private_session':%20False%7D HTTP/1.1" 404 None
05:40:13.312 - mycroft-spotify_forslund.spotify:play:133 - ERROR - http status: 404, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=%7B'name':%20'M1-Blue',%20'is_restricted':%20False,%20'type':%20'Speaker',%20'id':%20'87ae72b4a96cceadc3ae104587a18a690cd8e440',%20'is_active':%20True,%20'volume_percent':%2080,%20'is_private_session':%20False%7D:
 Device not found
05:40:13.329 - SKILLS - DEBUG - {"data": {"expect_response": false, "utterance": "An error occurred while processing a request in Spotify Skill"}, "type": "speak", "context": {}}
05:40:13.332 - mycroft.skills.core:wrapper:996 - ERROR - An error occurred while processing a request in Spotify Skill
Traceback (most recent call last):
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/spotipy/client.py", line 119, in _internal_call
    r.raise_for_status()
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.spotify.com/v1/me/player/play?device_id=%7B'name':%20'M1-Blue',%20'is_restricted':%20False,%20'type':%20'Speaker',%20'id':%20'87ae72b4a96cceadc3ae104587a18a690cd8e440',%20'is_active':%20True,%20'volume_percent':%2080,%20'is_private_session':%20False%7D

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 612, in spotify_play
    self.spotify.play(dev_id, uris, context_uri)
  File "/opt/mycroft/skills/mycroft-spotify.forslund/spotify.py", line 131, in play
    self._put(path, payload=data)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/spotipy/client.py", line 188, in _put
    return self._internal_call('PUT', url, payload, kwargs)
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/spotipy/client.py", line 124, in _internal_call
    headers=r.headers)
spotipy.client.SpotifyException: http status: 404, code:-1 - https://api.spotify.com/v1/me/player/play?device_id=%7B'name':%20'M1-Blue',%20'is_restricted':%20False,%20'type':%20'Speaker',%20'id':%20'87ae72b4a96cceadc3ae104587a18a690cd8e440',%20'is_active':%20True,%20'volume_percent':%2080,%20'is_private_session':%20False%7D:
 Device not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/venvs/mycroft-core/lib/python3.4/site-packages/mycroft/skills/core.py", line 987, in wrapper
    handler(message)
  File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 800, in resume
    self.spotify_play(self.dev_id)
  File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 617, in spotify_play
    raise SpotifyNotAuthorizedError
mycroft-spotify_forslund.SpotifyNotAuthorizedError

Shuffle/repeat control

Is there any plan to add support for shuffle/repeat state to this skill?

I'm happy to try and contribute, but I'd rather do so knowing it's desired. 😄

Just plays were it stoped last time

If I ask #hey Mycroft Play the album Hello Nasty on Spotify" he just starts laying Spotify - where it were last time it were stoped. What are I missing in getting him to find and play some music ?

Initiate shuffling when starting playback

Add "shuffle play" as a command to start playback in shuffle mode.

"Shuffle play Hello Nasty"

The question is should "play Hello Nasty" turn off shuffling or leave the shuffle mode unchanged?

command words works half way

Hello
I have stumbled uppon the problem that the command "play artist" dosent work. Mycroft only say "i dont under stand" and so on.
If i tell it to play something with artist, i get all wierd random result and not what i was asking for, or no result at all.
I have installed raspotify.
Mycroft acknowledged that it have it in the list of devices.
When telling play artist or song mycroft dont understand.

Is the play function broken?

Transfer playback

Transfer playback from one device to another

"Hey mycroft move spotify playback to my phone"

Error during command "play metal": "An error occurred while processing a request in Spotify Skill"

21:42:42.857 - __main__:handle_record_begin:35 - INFO - Begin Recording...
21:42:48.051 - __main__:handle_record_end:40 - INFO - End Recording...
21:42:48.055 - __main__:handle_wakeword:56 - INFO - Wakeword Detected: hey mycroft
21:42:50.326 - __main__:handle_utterance:61 - INFO - Utterance: ['play metal']
21:42:50.974 - mycroft.skills.core:wrapper:607 - ERROR - An error occurred while processing a request in Spotify Skill
Traceback (most recent call last):
File "/home/user/Projects/mycroft-core/mycroft/skills/core.py", line 598, in wrapper
handler(message)
File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 528, in play_song
self.play_playlist(message)
File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 600, in play_playlist
self.start_playlist_playback(dev, self.get_best_playlist(playlist))
File "/opt/mycroft/skills/mycroft-spotify.forslund/__init__.py", line 485, in get_best_playlist
key, confidence = match_one(playlist, self.playlists.keys())
File "/home/user/Projects/mycroft-core/mycroft/util/parse.py", line 56, in match_one
raise ValueError('a list or dict of choices must be provided')
ValueError: a list or dict of choices must be provided

Cannot play song with same name as playlist

Opening this one for the sake of completeness as I'm sure this will be an issue.

I suggest listening for the word "playlist" along with the search request.

For example, if I say "Play beast mode" it should play the first song in a spotify search (I think it's Beast Mode by A Boogie Wit da Hoodie). But if I say "play my beast mode playlist" it should play my playlist titled beast mode.

I know it may sound a little pedantic, but I'm sure this case will pop up in the future with someone else.

skill is sometimes not active

I've seen this several times and I think it only happens after an update. Spotify (on picroft) worked fine last night. Not today. Some logs attached. Immediately try again... works fine. weird....

spotifyfaillog.txt

The skill tries to start playback even when no devices are connected

I ran into the following issue when trying to setup spotify-skill for the first time on a headless server (not Mk. 1 or 2 hardware).

Steps to reproduce:

  1. Install the skill and configure it on home.mycroft.ai with your Spotify Premium credentials
  2. Start mycroft and utter "play something by "

Observed behavior:
spotify-skill attempts to start playback even when no devices are connected, which is the state my system was in, having not started Spotify on my PC and having not installed librespot or spotifyd.

It produces the following error:

20:04:56.269 - mycroft.skills.core:wrapper:607 - ERROR - An error occurred while processing a request in Spotify Skill
Traceback (most recent call last):
  File "/home/user/mycroft-core/mycroft/skills/core.py", line 598, in wrapper
    handler(message)
  File "/opt/mycroft/skills/spotify-skill/__init__.py", line 580, in play_artist
    return self.search(message.data['Artist'], 'artist')
  File "/opt/mycroft/skills/spotify-skill/__init__.py", line 616, in search
    self.spotify_play(dev['id'], context_uri=res['uri'])
TypeError: 'NoneType' object has no attribute '__getitem__'

Uttering "what spotify devices are available" produces:

20:10:06.622 - SKILLS - DEBUG - {"type": "3725241627858187020:list_devices", "data": {"confidence": 0.6666666666666666, "target": null, "intent_type": "3725241627858187020:list_devices", "DHCFCEBGCHIFIBIHACASpotify": "Spotify", "__tags__": [{"end_token": 1, "start_token": 1, "from_context": false, "entities": [{"confidence": 1.0, "data": [["Spotify", "DHCFCEBGCHIFIBIHACASpotify"]], "key": "spotify", "match": "spotify"}], "key": "spotify", "match": "spotify"}, {"end_token": 2, "start_token": 2, "from_context": false, "entities": 

Which seems to indicate that it's not yet configured to point to any devices.

Expected behavior:
The skill communicates the configuration state and suggests a solution for it, rather than attempting to play and throwing an error.

Doesn't work with family premium?

I have a family premium account (which is basically premium, but shared among multiple accounts)

I did the oauth, worked fine, and when I log into spotify, I see spotify-skills in my apps

However, when I say "list spotify devices" it always says "No spotify devices available"

Mycroft controls spotify on other devices, but not itself.

Similarly to this question: #29
I could not get mycroft to play anything by itself, even with raspotify installed. It just keeps telling me there are no spotify devices available. I'm wondering if I missed a step between installing raspotify and playing it through mycroft.

Thanks for any help!

special character in spotify password causes issues

in my case, there was a 'ü' (u'\xfc') in my spotify password, which apparently caused mycroft to spam me with errors as long as spotify was playing. changing the password (not too big a deal) did solve the issue, but i could not fnd any documentation of this so i figured i would share it here.
i have mycroft running in terminal on an archlinux (manjaro) system, please request any additional information if needed.

00:53:50.500 - SKILLS - DEBUG - {"data": {"expect_response": false, "utterance": "An error occurred while processing a request in Spotify Skill"}, "type": "speak", "context": {}}
00:53:50.560 - SKILLS - DEBUG - {"data": {"side": "b"}, "type": "enclosure.eyes.blink", "context": null}
00:53:50.566 - SKILLS - DEBUG - {"data": {}, "type": "recognizer_loop:audio_output_start", "context": null}
00:53:54.697 - SKILLS - DEBUG - {"data": {}, "type": "recognizer_loop:audio_output_end", "context": null}
00:53:55.283 - SKILLS - DEBUG - {"data": {}, "type": "3725241627858187020:MonitorSpotify", "context": null}
00:53:55.287 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.spotify.com
00:53:55.473 - requests.packages.urllib3.connectionpool - DEBUG - https://api.spotify.com:443 "GET /v1/me/player/currently-playing HTTP/1.1" 200 1015
00:53:55.486 - mycroft.skills.core:wrapper:609 - ERROR - An error occurred while processing a request in Spotify Skill
Traceback (most recent call last):
  File "/home/USER/mycroft-core/mycroft/skills/core.py", line 601, in wrapper
    self.settings.store()  # Store settings if they've changed
  File "/home/USER/mycroft-core/mycroft/skills/settings.py", line 552, in store
    if self._should_upload_from_change:
  File "/home/USER/mycroft-core/mycroft/skills/settings.py", line 534, in _should_upload_from_change
    if str(remote_val) != str(self_val):
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 7: ordinal not in range(128)

Spotify-skill does not find Sonos device

Hi,
This is an excellent skill and one of the most useful for a voice assistant.

The spotify and sonos integration works BUT I cannot have Mycroft to control Spotify music to Sonos speaker.
When listing spotify devices with voice command such as "list spotify devices", the spotify-skill finds all the local network devices except the Sonos Player3 (also in the local network).

Background:
In general, the skill seems to be working good. I have tried successfully to make Mycroft to control my Spotify playing in several applications: on the cellphone (spotify app), raspotify (local on the picroft), the laptop with spotify app, and on the web-player with firefox.

I also have a Sonos Play3 that is the speaker that I use the most with Spotify Premium account. It works fine to use the Sonos application or also any of the Spotify application in cellphone or in laptop to control Spotify music running on the Sonos speaker.

Thanks in advance for the help.

"stop the music" control does not work

Thanks for an awesome skill. I really enjoy this skill and would love to see it improve.
It does however not seem to listen when I tell it to stop. I believe the correct command is "stop the music"?
I can see on the terminal it does pick up the voice command. Goes silent for a moment then continues the music.
Any other logs or details I can send that will help?


play background

Just one moment while I look for that
Listening to the playlist background
stop playing music
stop the music stop the music


Doesn't appear on home.mycroft.ai

Installed the Skill via git to /opt/mycroft/skills (where all other skills are installed and working fine).

I can see the Podcasts configuration skill on the Skills settings page but cannot see the Spotify configurations Skill on home.mycroft.ai.

Any suggestions ?

An error has occured

Hey great skill thanks!

All commands result in an error has ocurred!
Like:

Hey mycroft, play drake on spotify

Only hey mycroft what devices are available, result in actual output.

Could anyone help me out?

Restriction to my playlists

Hi,
I'm having trouble getting my playlists to play. What is the recommended terminology to play only my playlists? Or perhaps there is a way to restrict playlist searching?

I have a "Christmas 2019" playlist. mycroft gets the "play christmas 2019 playlist" utterance correct and then plays something truly unexpected:
_play christmas 2019 playlist

Just one moment while I look for that
Listening to 2019 Electronica Playlist For Christmas Lounge by Various Artists._

Advice?

Error occured while processing

Hi! Amazing work, really appreciate it! I used it alot until "error occured while processing a request in Spotify Skill". Picroft, latest image, Pi Model B.
** mycroft-core: 18.8.11 ( dev )


Log Output: 21-33 of 51
====================================================== mycroft-core 18.8.11 ===
File "/home/pi/mycroft-core/mycroft/skills/core.py", line 886, in wrapper
handler(message)

    result = self.CPS_match_query_phrase(search_phrase)
~~~~s/mycroft-spotify.forslund/__init__.py", line 477, in CPS_match_query_phrase
    confidence, data = self.generic_query(phrase, bonus)
~~~~oft/skills/mycroft-spotify.forslund/__init__.py", line 553, in generic_query
    playlist, conf = self.get_best_playlist(phrase)
~~~~skills/mycroft-spotify.forslund/__init__.py", line 698, in get_best_playlist
    list(self.playlists.keys()))
  File "/home/pi/mycroft-core/mycroft/util/parse.py", line 64, in match_one
    best = (_choices[0], fuzzy_match(query, _choices[0]))
IndexError: list index out of range
History ==============================    Log Output Legend ====== Mic Level ===
 play my heart will go on by celine       skills.log, other
 dion                                     voice.log
 >> An error occurred while processing
    a request in Spotify Skill
 >> I'm not sure how to play my heart                                 --- 61.41
    will go on by celine dion                                      56  *

Also, before that i had a problem form time to time regarding resolving player..a lot of times mycroft respond with "not sure how to play X". I managed to use it with "search X on spotify". 

Tell me if you need anything else for debugging or point me in the right direction. please.

Best regards and keep up the good job!

acknowledge spotify start

When "play spotify" is received the skill starts without any feedback to the user.

I suggest the self.acknowledge() method is used to indicate that the command has been received.

It can simply be added after the continue check here

Additional scope required for collaborative playlists

I'm setting up Mycroft to use an account with collaborative playlists in Spotify. After looking through the Spotify API documentation, it looks like the playlist-read-collaborative OAuth scope is required to include collaborative playlists in current_user_playlists().

I added the scope manually during the OAuth handshake, and confirmed that it fixes the issue. I'm still new to developing Mycroft skills, and I don't see any way where you've set the scopes for this application, so I can't see a way to create a Pull Request for this behaviour.

While I have this working for myself, I thought you might want to add the playlist-read-collaborative scope to this skill for everyone else.

Thanks! 😄

Specific Album Request

Mycroft does not respond to requests for album such as:
"Hey Mycroft, play the album Led Zeppelin 3 on Spotify"

"Hey Mycroft Play Spotify" doesn't work

Is it possible to start playing the last song, album, station or playlist that the user listened to on Spotify? Mycroft's response could be:
"Playing the last song you listened to on Spotify" or "playing where you left off on Spotify"

Playlist support

Add capability of using phrases like "Start playlist XXXX on spotify" and "Play my XXXX playlist"

Ducking is not working

I can't find a way to enable ducking. Just browsing through the source code, I tried setting use_ducking: true in the settings.json file, rebooted mycroft, rebooted the pi, etc. No avail. For the record, all voice commands still work, I just want the music to pause so that a) I know Mycroft heard me and b) so Mycroft can hear me more clearly. How do you enable ducking correctly?

No spotify devices found

Disclaimer: Not sure if this is a skill bug per say or raspotify or the way spotify connect works.

Initially when I installed the skill and I also noticed it now when I do not use it for a day or two.
When I try and play something from spotify or ask "what spotify devices are available". I always get response "No spotify devices are available".
I initially though maybe its raspotify that died so restarted the daemon regardless but still nothing.
Once I use the android Spotify app and search for devices I see raspotify and are able to stream music to it.
Once its started playing and I stop again. I try the "what spotify devices are available" and now finds my mobile phone and raspotify as available devices.

Cannot play public playlists

Not sure if this is going to be implemented but for example if I say "Play beast mode by spotify" it won't work. Seems like there's no language processing for anything more than "play X"

Every search request is made with an album search category

It seems that every search query is made with the album search category.

I think it would be nice if we can choose this or those category's are just enabled when I say it to the skill.
-> play firworks album on spotify -> api-url....fireworks&cat=album
-> play firworks on spotify -> api-url....fireworks&cat=none_or_top_results

Is this possible?

My config is:
-Raspberry pi 4 - with 4GB
-Respeaker Mic Array v2.0 https://www.seeedstudio.com/ReSpeaker-Mic-Array-v2-0.html
-Picroft Unstable 2019-11-01 Buster image
-Mycroft-Core 19.8.3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.