forslund / spotify-skill

Mycroft Skill to control spotify using the Spotify Connect API
Apache License 2.0
71 stars 38 forks source link

Cannot connect my spotify account #152

Open Lenteguppie opened 3 years ago

Lenteguppie commented 3 years ago

When I want to configure your Skill with my Spotify credentials I get an error page with the error: INVALID_CLIENT: Failed to get client. Am I doing something wrong?

mickenordin commented 3 years ago

What devices are you trying with?

I have some chromecast devices. It works well enough for me with the current mode of operation, I was just surprised that nothing was showing up first :)

awdel commented 3 years ago

I have been able to successfully connect to Spotify and can use Mycroft to remotely play Spotify songs on my phone but I have been unable to set my Picroft as a device.

When Spotify is not open on my phone and I say "What Spotify devices are available?", Mycroft replies with "There are no Spotify devices available".

I have added my Username and Password to 'Play Spotify' section of my skills, however when I click on the 'Connect' button, it opens a page that simply says 'INVALID_CLIENT: Failed to get client' at the following url:

https://accounts.spotify.com/authorize?client_id=[MYCLIENTID]&redirect_uri=https%3A%2F%2Fapi.mycroft.ai%2Fv1%2Fauth%2Fcallback&scope=user-library-read+streaming+playlist-read-private+user-top-read+user-read-playback-state

Can anyone shed any light on where I am going wrong. Thanks.

mickenordin commented 3 years ago

I have been able to successfully connect to Spotify and can use Mycroft to remotely play Spotify songs on my phone but I have been unable to set my Picroft as a device.

When Spotify is not open on my phone and I say "What Spotify devices are available?", Mycroft replies with "There are no Spotify devices available".

I have added my Username and Password to 'Play Spotify' section of my skills, however when I click on the 'Connect' button, it opens a page that simply says 'INVALID_CLIENT: Failed to get client' at the following url:

https://accounts.spotify.com/authorize?client_id=[MYCLIENTID]&redirect_uri=https%3A%2F%2Fapi.mycroft.ai%2Fv1%2Fauth%2Fcallback&scope=user-library-read+streaming+playlist-read-private+user-top-read+user-read-playback-state

Can anyone shed any light on where I am going wrong. Thanks.

Hi, I don't think a spotify player is integrated in this skill. If you wish to play music on your raspberry pi you can do what I did and install raspotify on there: https://github.com/dtcooper/raspotify

awdel commented 3 years ago

Hi, I don't think a spotify player is integrated in this skill. If you wish to play music on your raspberry pi you can do what I did and install raspotify on there: https://github.com/dtcooper/raspotify

Thank you @mickenordin, that was it. The Pi is now showing up as a device and it does try to play the tracks, however there is no sound output to my speakers. I am using a USB DAC with external speakers so I think some tweaking of the output device is required.

Frederic94220 commented 3 years ago

Hello, everyone, I have the INVALID-Client issue and I tried to understand what all of you guys said here, I have almost no capacities in this domain so is it possible to have some help with my problem or like a complete guide ^^? I am really sorry to make you guys do all over your explanations again Thanks for your help in advance! BTW I'm running a Rasp pi 3 model B ^^

forslund commented 3 years ago

Hi @Frederic94220 Above in a comment made the 30th Oct I've provided some instructions. I'm going to try to get a bit more streamlined approach into the skill during next week. (Most is done, just trying to document things).

It won't be perfect but a bit better than following instructions in an issue on github.

forslund commented 3 years ago

I've now merged the change to allow local api keys, with a basic helper script and instructions in the readme. Still work to do before it's completely user friendly however.

Loopinglu commented 3 years ago

Do you mean the readme of the spotify skill? Cause I can't see a change there... Obviously I have the same problem an tried your instructions @forslund but I despair already at the first one. What shall I do once I have a spotify developer account? What whitelist? And what is a secret? As you may notice, I have no idea about coding but I really want to use the spotify function with my picroft again. I really loved it... Would be great if one of you could help me out <3

forslund commented 3 years ago

Yes, the steps I've written are here: https://github.com/forslund/spotify-skill#creating-access-token

I'd be happy to get feedback if there are things that are unclear, to improve it :)

Loopinglu commented 3 years ago

Yes, the steps I've written are here: https://github.com/forslund/spotify-skill#creating-access-token

I'd be happy to get feedback if there are things that are unclear, to improve it :)

Alright, you want feedback @forslund, I hope you don't regret this ;D I got until

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

I managed to run source venv-activate.sh but when I tried to run python /opt/mycroft/skills/mycroft-spotify.forslund/auth.py I got this: python: can't open file '/opt/mycroft/skills/mycroft-spotify.forslund/auth.py': [Errno 2] No such file or directory

And it actually does look like the file auth.py does simply not exist. I tried reinstalling mycroft-spotify but that did'nt change it. Yeah, so that's how far a total amateur aka me got :)

forslund commented 3 years ago

Thanks, I must add a note that this hasn't been released to the mainline (there will currently be some conflicts with the Mark-1 install until the next release of core). Currently you need to ask Mycroft to install the beta version of the skill (or use the -l flag with msm), or install it manually.

JesusCendejas commented 2 years ago

hello, good morning, sorry, when I try to configure my spotify account in mycroft, a page appears saying INVALID_CLIENT: Failed to get client, how can I fix it?

forslund commented 2 years ago

Hi @JesusCendejas, sorry for the delay in answering. Currently you need to install the beta version of the skill, you should be able to say "Hey mycroft, install the beta version of the spotify skill". Then you need to follow the instructions from the readme here: https://github.com/forslund/spotify-skill#authorization

Let me know if you get stuck some where and we'll try to improve the instructions

arkadiy-telegin commented 2 years ago

Hey @forslund, after downloading the beta version of the skill and following the guide in README.md, I still get an error. After I put my username and password into the corresponding fields at account.mycroft.ai/skills, I get the following message:

INVALID_CLIENT: Failed to get client
forslund commented 2 years ago

Where do you get that, is it the skill log or is it when running the auth script?

Another thing that may be of interest, what platform is this on?

arkadiy-telegin commented 2 years ago

auth.py finishes successfully, after that (according to README.md) one has to add the account into the skill settings at https://account.mycroft.ai/skills. This is the step where the setup fails. After saving the configuration and pressing the "Connect" button, INVALID_CLIENT: Failed to get client is returned by the webpage.

I have my mycroft running in docker.

forslund commented 2 years ago

Ok, something is off, after the update there should be no Connect button on the skills page. Can you verify that the skill starts successfully by either using the :skills command in the mycroft-cli (if the skill is red it hasn't loaded correctly) or asking Mycroft "what spotify devices are available" (he should reply with something about missing credentials).

Also if you have several installs there may be tabs on the skill page with multiple versions of the spotify skill

JesusCendejas commented 2 years ago

@forslund Thank you very much. The truth is that I was able to register the spotify account, however when I ask What Spotify devices are available? mycroft returns There are no Spotify devices available, just like when I say some command like Play Hello Nasty on Spotify it prints I'm not sure how to play Play Hello Nasty on Spotify, how can I fix it? good evening

forslund commented 2 years ago

The problem may be that there is no spotify-connect enabled player set up? The skill is not a player on it's own, instead it uses the spotify-connect api to start playback on detected devices (they need to be logged in with user / password...see readme). It was developed with librespot and the Spotify desktop-client as reference devices.

Maxibraeu commented 2 years ago

Hello @forslund I read through your intructions and then tried to run the spauth.py, but when I enter the url I was redirected to I get the following error:

  File "spauth.py", line 13, in <module>
    sp = spotipy.Spotify(auth_manager=am)
TypeError: __init__() got an unexpected keyword argument 'auth_manager'

I would be really greatful for any help

forslund commented 2 years ago

Hi @Maxibraeu, the instructions here are a bit dated. please checkout the default branch (21.02) and follow the instructions in the readme.md here.

Since you've switched branches back and forth the incorrect version of spotipy may be installed. So you might need to run something like

source venv-activate.sh
mycroft-pip install -r /opt/mycroft/skills/mycroft-spotify.forslund/requirements.txt

Let me know how you get along with that and I'll try to help you further if you get stuck.

Maxibraeu commented 2 years ago

Hi @forslund its me again,first thanks for your quick response. I tried to do the new installation but failed on following error while installing raspotify. After I did sudo apt install raspotify following error ocurred

 raspotify : Depends: libc6 (>= 2.31) but 2.28-10+rpt2+rpi1+deb10u1 is to be ins                                                                                                                                                             talled
             Depends: libasound2 (>= 1.2.4)
             Depends: alsa-utils (>= 1.2.4) but 1.1.8-2+rpt1 is to be installed
             Depends: libpulse0 (>= 14.2) but 12.2-4+deb10u1+rpt3 is to be installed                                                                                                                                                          
             Depends: systemd (>= 247.3) but 241-7~deb10u8+rpi1 is to be installed                                                                                                                                                          
             Depends: init-system-helpers (>= 1.60) but 1.56+nmu1 is to be installed                                                                                                                                                          
E: Unable to correct problems, you have held broken packages.

but if I search for example libc6 there is no version 2.31

Thanks for help

forslund commented 2 years ago

@Maxibraeu sorry for the late response. I've been away for a couple of days. Can you tell me what system you're running on?

Assuming that it's the picroft you're using: It could be that Raspotify has switch to the latest Debian Bullseye as target for their build and the picroft is still based on the old Debian Buster. I shall test this and see if I can do a custom build and provide a repo for the picroft.

Maxibraeu commented 2 years ago

@forslund you are completely right. I am using Picroft and it would be really nice if you could make a custom build and provide a repo. Thank you very much. 😃

forslund commented 2 years ago

@Maxibraeu sorry for the long response time. I haven't gotten around to creating a debian repo of my own but I checked my version and you can download the deb from this github tag: https://github.com/dtcooper/raspotify/releases/tag/0.31.3

My guess is that all 0.31.x releases will work.

Maxibraeu commented 2 years ago

Hi @forslund thanks for you anwer, I installed your version of Raspotify and then found all files from your description , but when I was going on and then finaly tried to use the Skill there was an Error again wich looked like this:

play never gonna give you up on spotify                    
 >> Just a second                                           
 >> Unable to authorize with the Spotify service. Please
    go to Skill settings at home dot mycroft dot ai to
    verify your username and password and to Connect to                                                     
    Spotify.

And when I do What he says I get the same Error. But I got an Email from Spotify that a new device has logged into my account

Thaks for your Help. 😄

Maxibraeu commented 2 years ago

@forslund Its me again I saw that I used the wrong username and now its working thanks for all you help during the last weeks 😄

marcoxx86 commented 1 year ago

hello I have a problem I follow everything but I get stuck at this command

git checkout feature/local-api-key

giving me this error

error: pathspec 'feature/local-api-key' did not match any file(s) known to git

how can i solve? what am I missing?

thank!!!!!

@Maxibraeu sorry for the long response time. I haven't gotten around to creating a debian repo of my own but I checked my version and you can download the deb from this github tag: https://github.com/dtcooper/raspotify/releases/tag/0.31.3

My guess is that all 0.31.x releases will work.

hello I have a problem I follow everything but I get stuck at this command

git checkout feature/local-api-key

giving me this error

error: pathspec 'feature/local-api-key' did not match any file(s) known to git

how can i solve? what am I missing?

thank!!!!!