-
Notifications
You must be signed in to change notification settings - Fork 38
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
Auth.py missing; wrong import for SpotifyOAuth #163
Comments
Hi, thanks for reporting :) A couple of questions
Just to verify did you run
from the mycroft-core folder? Can you please run Also welcome to github, glad to have you here providing feedback and helping to improve the skill! |
Hi, |
Ok, the spotify skill version hasn't been updated in mycroft-skills store so the latest changes for the manual authentication hasn't been added to that version. Try asking mycroft to
which should update the skill to the latest version and update the requirements along with it. (can be some issues though since you've manually added files...). Currently I think both the |
Asking mycroft to install the beta version did not work as mycroft asked me which version I am referring to. I did not know the answer to this. First error: Since then I am clueless. |
I had the same problem. With .venv activated I typed: |
Hi, thanks this already helps a lot and brings me one step further. However, the auth then asks to "Enter the URL you were redirected to" I don't understand. I was redirected to nowhere. I entered localhost:8888 but why should this work. Also trying to connect to localhost:8888 does not work. Any idea what I am supposed to enter here? |
spotipy should have opened up the browser or showed you a link to paste in the browser. The link would take you to spotify where you allow the application to connect to your account. Afterwards it would redirect you to a However if the beta update didn't succeed the rest of the skill won't be able to use the auth token the auth script generates. @Jean28518 how did you update to the latest version? git pull or msm / voice? |
I have the same problem as Wattseheck ... I don't really understand the last part. I am doing this in a console via ssh so no browser will open up and also no link is shown in terminal. |
Thanks for the feedback @wieluk, The lib should have show an url, and if this is missing for you there's a bug. I'll try to reproduce. is this picroft or other system? |
Thanks for your fast answer it is raspbian os 32bit with mycroft installed for linux |
Nothing new to report, im getting the same issue as others when running auth.py. Where things seem to go well until I am prompted to "Enter the URL you were redirected to". From other comments it seems like the expectation is that, at this point, auth.py is supposed to open a browser window. Has anyone figured out a way to make this work / get the necessary data via an SSH connection to the picroft? Thanks you! Im very excited to get this working :) |
I just pushed a change to enforce showing the link in all cases. let me know if this helps. |
Thanks for the fast change. But now I get this after entering client id and secret.
I am using this "from spotipy.oauth2 import SpotifyOAuth" suggested by wattseheck instead of the one in your auth.py file because with yours i get this Error |
Hmm, could you check the version of spotipy you're using? (If you've updated with a |
Thanks @forslund! That definitely moved things along! I was able to successfully get through the auth.py script with your change of Unfortunately, i am unable to control Spotify with Mycroft because I am prompted to set up my credentials at home.mycroft.ai. But this process seems to be broken too? any interactions with the username / password / connect inputs results in a new page opening with INVALID_CLIENT: Failed to get client. Do you have any suggestions about this? |
yea for me auth.py works now aswell but same problem with INVALID_CLIENT: Failed to get client. |
You shouldn't need to connect in the skill settings. just add username and password and save (auth.py replaces the need for using the web connect flow) |
Best test of the skill is to ask |
well the auth.py doesnt complain it just asks me if I want to save the client secrets i said yes. When I ask what devices are available it answers with |
Hmm, that is strange. as long as the username and password is set on home.mycroft.ai and auth.py is run it should be able to connect after a restart... Edit: The user / password requirement thing on home is technically something that can be dropped now, was mainly to not spam the oauth endpoint if the user hadn't set up spotify yet...since that endpoint isn't used anymore it should be safe to just do the auth even if no username is set. Mainly Mark-1 that has use for the username and password since on that platform it runs the spotify player as well. |
I've pushed 2 small changes now,
|
@forslund, my person! Branch 20.08 is working for me now. You rule! |
Oh, sweet! Thanks for the feedback! Let me know if there are follow up issues. |
I've been playing with it a bit and it seems to be working well! There's one minor "bug" that isnt really that big of a deal, butlet me know what you think: Things work perfectly if i initiate the spotify session / playback with a Mycroft voice command. The bug occurs when I initiate the raspberry pi playback directly through the Spotify app (i.e. start playing music on the phone app then change the playback device to be the Picroft device). The device switch and playback works well (i think through a standalone raspotify instance that is not related to mycroft) but if i then try to control the raspberry pi playback with mycroft commands mycroft seems confused and doesnt know that a raspotify session is already in progress. Does this make sense? So Im wondering if it's possible for mycroft to check if raspotify is already running so that it can interact with it (e.g. "pause tspotify", "turn off spotify", etc.). Let me know if I should submit a separate issue. Thanks! |
That is something I've left out intentionally so far, it hasn't been entirely clear when mycroft should "take control" over the playback. what you write makes sense however, if it's playing on the mycroft device it should be aware and able to control it in any case. please open a separate issue with this and we can continue to discuss the interaction there. |
thanks for me it works now too :) edit:
edit: |
The traceback looks like some trouble with the translation? Are you running en-us or some other language?
If you did an install using the github link it may have downgraded spotipy for you. Does "what spotify devices are available" still work for you? |
I am still facing the issue of authorization:
Git status:
I also entered the details on Mycroft skill workshop button, I was unable to get the connect button like before. I have done a git clone of this repo into the mycroft-core in its skills folder Device Info:
|
@Xanaxus did you run the auth.py script successfully after doing the clone? Also you shouldn't have a Connect button to press anymore... The complete process should be something like this (assuming the skill doesn't exist locally already. if so remove it)
Follow the instructions in the script and chose to save the Client Secret.
Go to the skills page on the mycroft website. Enter your username and password then hit save. If the skill is up to date there should be no "Connect" button to press. Now that 21.02 of core is released I should be able to push the update to the skill store removing a couple of these steps making things slightly easier. |
I tried the above. When restart MyCroft I get "SpotifySkill | Couldn't fetch credentials" |
Ok, I forgot source venv-activate.sh Now I get
Note: I do have listed mycroft-spotify.forslund |
I'm trying to get the spotify skill working on a mycroft that I've installed on a linux desktop. I've read through the thread above and think I followed all the steps install the beta version of the spotify skill source venv-activate.sh and pip install spotipy --upgrade and run auth.py and followed all the instructions but what I see in the log is the that the skill fails to load.
|
Hi Try resetting the version to the expected 2.17.1 (this was installed when you asked mycroft to install the beta version)
and then try to |
I've upgraded here and I can't reproduce your issue @pjchamberlain. Could you provide the output from
and
so I can see if I can make a better reproduction of the system. |
Thanks you've indirectly highlighted some problems with my python and pip set up .. I'm on Ubuntu 22.04 and haven't actively touched python or pip for a few years until my Mycroft Mark 2 arrived. Fixing the issues with python and pip so that the simple commands above run without errors, and then restarting mycroft and repeating all the setup steps .. has got it working. This is with spotipy 2.22.0 Happy days. Thanks for your help. I've learned a lot about mycroft. My next puzzle is what to do with my Mark 2 .. |
If you set up the spotify skill on the mark 2 feel free to submit fixes or updates to the readme to get it going. |
Porting skills to the Mark 2 is a bit beyond me at this point. I hadn't looked at Mycroft code at all until my Mark 2 arrived. There is very little information about getting started on the Mark 2. I followed the guide to porting hello world, and got that working eventually. I'm not sure what the best way forward is - replace Dinkum on my Mark 2 with something else or to try to learn how to port skills I want onto Dinkum. The mycroft ai forum has a lot of people asking the same question. |
My Mark-2 arrived today but will likely not start experimenting with it until after new years. I was thinking of going the "sandbox" way but maybe getting it onto Dinkum is a possibility |
The instructions in this comment worked fine on a Docker instance of mycroft. Any news on releasing the latest version to the store to make it simpler to install this skill? |
Describe the bug
Auth.py does not install when installing mycroft-spotify. When running Auth.py SpotifyOAuth is loaded from the wrong package and thus fails.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Importing SpotifyOAuth
Solution
Environment (please complete the following information):
Additional context
I am sorry. This is literally my first time on GitHub and I am no developer or have any experience. Bear with me if anything is unconventional.
The text was updated successfully, but these errors were encountered: