Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skill can't find any music #149

Open
btburton42 opened this issue Aug 26, 2020 · 6 comments
Open

Skill can't find any music #149

btburton42 opened this issue Aug 26, 2020 · 6 comments

Comments

@btburton42
Copy link

Skill can't find any music

Hi there, hope you can help me with this. Maybe it's a bug with you, maybe with MyCroft?

Skill worked until this morning. Have it installed via PiCroft. SSH'd into box for some reason (I don't quite remember) and MyCroft autoupdated. Now Spotify is broken. It was really my favorite part about this voice assistant.

Here's the log when I search for Tom Petty.

 04:45:05.716 | DEBUG    | 25162 | mycroft.skills.intent_service:handle_utterance:346 | Utterances: ['play bob marly on spotify']
~~~~ DEBUG    | 25162 | mycroft.skills.intent_service:handle_utterance:366 | Padatious intent: {'name': 'mycroft-audio-record.mycroftai:PlayRecording.intent', 'sent': 'play bob marly on spotify', 'matches': {}, 'conf': 0.5012202271906231}
~~~~ 'data': [('bob marly', 'mycroft_playback_control_mycroftaiPhrase')], 'confidence': 0.5}], 'confidence': 0.5, 'end_token': 2, 'match': 'bob marly', 'key': 'bob marly', 'from_context': False}], 'utterance': 'play bob marly on spotify'}
 04:45:06.378 | INFO     | 25162 | Playback Control Skill | Resolving Player for: bob marly on spotify
 04:45:08.589 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:45:08.621 | INFO     | 25162 | mycroft-pandora_mycroftai:_extract_station:426 | generator raised StopIteration
 04:45:08.627 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:45:08.634 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:45:08.651 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:45:08.885 | DEBUG    | 25162 | Playback Control Skill | CommonPlay Resolution: bob marly on spotify
 04:45:08.885 | INFO     | 25162 | Playback Control Skill |    No matches

Also of note. Installed Pandora since I figured it was worth a try while yours was down:

~~~~DEBUG    | 25162 | mycroft.skills.intent_service:handle_utterance:366 | Padatious intent: {'name': 'mycroft-audio-record.mycroftai:PlayRecording.intent', 'sent': 'play bob marley on pandora', 'matches': {}, 'conf': 0.5012202271906231}
~~~~ta': [('bob marley', 'mycroft_playback_control_mycroftaiPhrase')], 'confidence': 0.5}], 'confidence': 0.5, 'end_token': 2, 'match': 'bob marley', 'key': 'bob marley', 'from_context': False}], 'utterance': 'play bob marley on pandora'}
 04:50:56.999 | INFO     | 25162 | Playback Control Skill | Resolving Player for: bob marley on pandora
 04:50:58.214 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:50:58.256 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:50:58.272 | DEBUG    | 25162 | mycroft.skills.mycroft_skill.event_container:add:146 | Added event: mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:50:59.742 | DEBUG    | 25162 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 04:51:00.050 | DEBUG    | 25162 | urllib3.connectionpool | https://api.mycroft.ai:443 "POST /v1/device/b6785b24-8704-4995-b426-5635cfeee41b/metric/timing HTTP/1.1" 204 0
Removing event mycroft-playback-control.mycroftai:PlayQueryTimeout
 04:51:03.393 | DEBUG    | 25162 | Playback Control Skill | CommonPlay Resolution: bob marley on pandora
 04:51:03.394 | DEBUG    | 25162 | Playback Control Skill |     0.5125 using mycroft-pandora.mycroftai
 04:51:03.401 | INFO     | 25162 | Playback Control Skill | Playing with: mycroft-pandora.mycroftai
 04:51:03.860 | INFO     | 25162 | Playback Control Skill | Audio service status: {}
 04:51:35.473 | DEBUG    | 25162 | urllib3.connectionpool | Starting new HTTPS connection (1): api.mycroft.ai:443
 04:51:35.759 | DEBUG    | 25162 | urllib3.connectionpool | https://api.mycroft.ai:443 "GET /v1/device/b6785b24-8704-4995-b426-5635cfeee41b/skill/settings HTTP/1.1" 304 0
@forslund
Copy link
Owner

Hi,

sadly Spotify disabled the API access for this skill. It violated their Terms of Service, it's apparently not OK to make a voice integration for Spotify without their written approval. I missed this when I set up the skill back in 2017 (or maybe it was added afterwards), sorry for the inconvenience.

I've tried to contact them for approval but without getting anywhere. I will try to make it possible for people to supply their own api keys but it will have to wait a short while.

@gador
Copy link

gador commented Aug 26, 2020

Hi @forslund ,

I tried to understand your code concerning the API..If I understood spotipy and the authorization guide of spotify correctly, one needs an App authorization to use the API of spotify. Looking at spotipy and your code, you seem to provide "dev_cred" to obtain a token for the API access to spotify..correct?

Is this a mycroft-wide dev-token for spotify? Or is it something else?
I'm just trying to understand where someone would need to inject their respective own API device keys.. (spotipy seems to use the CLI with export export SPOTIPY_CLIENT_ID and export SPOTIPY_CLIENT_SECRET to set the correct device access to the API)..

Thanks

@forslund
Copy link
Owner

forslund commented Aug 26, 2020

Mycroft has an "oauth cred store" which the spotify skill uses. I plan on adding support for the normal spotipy auth scheme allowing users to create keys themselves

You should be able to change 273-274 to be something like

            from spotipy.oauth2 import SpotifyClientCredentials
            self.spotify = SpotifyConnect(client_credentials_manager=SpotifyClientCredentials())

and it should use the env variables. (this is all theoretical I've just begun looking at implementing it (again...back in 2017 I had code for this)

@gador
Copy link

gador commented Aug 26, 2020

Thanks, I look forward to it :)

PS: If I can help in any way, just let me know.

@forslund
Copy link
Owner

If you test and get something going, make a pull request :) Apart from that some usability tests will definitely be needed

@btburton42
Copy link
Author

Ah well... Thanks for the quick reply @forslund. I wish I had time to offer support but wth my current situation that's a non-starter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants