I am not sure wether this is the right form and i am pretty new to this stuff, so please bear with me...
Currently, I am trying to automate a few things in my home. One thing is related to Spotify. To do that i wrote a python script, which works good on my laptop, but when I transfer it over to my NAS-Server (OpenMediaVault6) the script doesn't work. I want it there for task scheduling.
I think I know where the problem is, but I don't know how to fix it. In the python script I have to get an access token from spotify. For that I need to authenticate myself in a browser, but on a NAS-Server that is not possible as far as I know.
I tried to solve it with a Client Credentials Flow, but I need to access my user information.
This is a simplified code:
import spotipy
CLIENT_ID = "client_id"
CLIENT_SECRET = "client_secret"
REDIRECT_URI = "http://localhost:8888/callback"
USER_ID = "user_id"
SCOPE = "user-read-private user-read-email"
token = spotipy.util.prompt_for_user_token(USER_ID, SCOPE, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI)
print(token)
Does anyone have a smart idea how to get this running on the NAS?
Thansk in advance.