Code Monkey home page Code Monkey logo

Comments (11)

forslund avatar forslund commented on May 25, 2024

Hi, what platform are you on? I assume you chose to save the credentials, I wonder if Mycroft is run on a different user than the one setting up the auth?

from spotify-skill.

colinbrogan avatar colinbrogan commented on May 25, 2024

Running a Mycroft Mark 1 with 21.2.0 software

from spotify-skill.

colinbrogan avatar colinbrogan commented on May 25, 2024

I saved the credentials in the skill settings, although there was no "connect" button in the skill settings to click (which the directions said to click). Also ran the auth script with all the dev account API stuff

from spotify-skill.

colinbrogan avatar colinbrogan commented on May 25, 2024

Also changed the user in the systemd service here:
"
[Unit]
Description=Raspotify
After=network.target

[Service]
User=pi
Group=pi
Restart=always
RestartSec=10
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -m 0755 -p /var/cache/raspotify ; /bin/chown raspotify:raspotify /var/cache/raspotify
Environment="DEVICE_NAME=raspotify (%H)"
Environment="BITRATE=160"
Environment="CACHE_ARGS=--disable-audio-cache"
Environment="VOLUME_ARGS=--enable-volume-normalisation --volume-ctrl linear --initial-volume 100"
Environment="BACKEND_ARGS=--backend alsa"
Environment="DEVICE_TYPE=speaker"
EnvironmentFile=-/etc/default/raspotify
ExecStart=/usr/bin/librespot --name ${DEVICE_NAME} --device-type ${DEVICE_TYPE} $BACKEND_ARGS --bitrate ${BITRATE} $CACHE_ARGS $VOLUME_ARGS $OPTIONS

[Install]
WantedBy=multi-user.target
"

from spotify-skill.

colinbrogan avatar colinbrogan commented on May 25, 2024

Also activated the mycroft-core venv before running auth.py with this:
source /opt/venvs/mycroft-core/bin/activate

from spotify-skill.

forslund avatar forslund commented on May 25, 2024

On the Mark-1 Mycroft is run by a service user called mycroft. So it might be that you do this from the pi user and the config is saved in the incorrect user's config folder. I think you should do the following (if you haven't already):

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

Then to be certain, restart Mycroft

from spotify-skill.

forslund avatar forslund commented on May 25, 2024

In the latest readme / settings page the "click connect" instructions has been removed (as far as I know). Where did you read those instructions?

from spotify-skill.

colinbrogan avatar colinbrogan commented on May 25, 2024

OK! running auth from the mycroft user surely fixed it!
I've looked through the code on some of your skills, and thought about making some modifications and pushing them. Is there any specific reason you are doing this authentication from a python script, rather than having the user store these credentials in the skill's settings? I thought about rewriting your skill to make it easier for non-programmers, and perhaps pushing a merge request (if you find the code to be good).

from spotify-skill.

forslund avatar forslund commented on May 25, 2024

This is a bit of a stop-gap solution. The oauth system was integrated with the Mycroft cloud in a "fairly" secure manner but Spotify shut down my client id for violation of their terms (using the API for voice interactions). So I knocked out this script so the the skill could still be used...

Possibly a hybrid solution could be done. You enter the credentials one time on the cloud when they're synced they can be removed from there.

I'm happy to accept a PR if you come up with a good solution.

from spotify-skill.

amil109 avatar amil109 commented on May 25, 2024

On the Mark-1 Mycroft is run by a service user called mycroft. So it might be that you do this from the pi user and the config is saved in the incorrect user's config folder. I think you should do the following (if you haven't already):

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

Then to be certain, restart Mycroft

Thank you for this - I had been trying for a long time to get the auth process to work - it was these 3 lines I needed. I don't know how many users are using a MK1 rather than a picroft or something else, but it might be worth adding these to the readme?

from spotify-skill.

forslund avatar forslund commented on May 25, 2024

@amil109 yes, you are correct. it should be added to the readme. will handle that

from spotify-skill.

Related Issues (20)

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.