diff --git a/src/conffile.c b/src/conffile.c index 0476803f..695e0856 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -219,6 +219,9 @@ static cfg_opt_t sec_spotify[] = CFG_BOOL("artist_override", cfg_false, CFGF_NONE), CFG_BOOL("album_override", cfg_false, CFGF_NONE), CFG_BOOL("disable_legacy_mode", cfg_false, CFGF_NONE), + // Issued by Spotify on developer.spotify.com for forked-daapd/OwnTone + CFG_STR("webapi_client_id", "0e684a5422384114a8ae7ac020f01789", CFGF_NONE), + CFG_STR("webapi_client_secret", "232af95f39014c9ba218285a5c11a239", CFGF_NONE), CFG_END() }; diff --git a/src/library/spotify_webapi.c b/src/library/spotify_webapi.c index 8e8e61b8..5f98e0ea 100644 --- a/src/library/spotify_webapi.c +++ b/src/library/spotify_webapi.c @@ -147,10 +147,10 @@ static int spotify_base_plid; // Flag to avoid triggering playlist change events while the (re)scan is running static bool scanning; - // Endpoints and credentials for the web api -static const char *spotify_client_id = "0e684a5422384114a8ae7ac020f01789"; -static const char *spotify_client_secret = "232af95f39014c9ba218285a5c11a239"; +static const char *spotify_client_id; +static const char *spotify_client_secret; + static const char *spotify_scope = "playlist-read-private playlist-read-collaborative user-library-read user-read-private streaming"; static const char *spotify_auth_uri = "https://accounts.spotify.com/authorize"; @@ -2067,6 +2067,9 @@ spotifywebapi_library_init() { int ret; + spotify_client_id = cfg_getstr(cfg_getsec(cfg, "spotify"), "webapi_client_id"); + spotify_client_secret = cfg_getstr(cfg_getsec(cfg, "spotify"), "webapi_client_secret"); + ret = spotify_init(); if (ret < 0) return -1;