Replies: 1 comment 1 reply
-
Adding the OAuth token to the song would not work properly; there are no such "song properties", and if you need a new token, it would invalidate all songs, because they all have a copy of the old token. And you wouldn't be able to share links with friends who have a different token. I guess for this to work, we'd need a way for the SoundCloud playlist plugin to intercept all CURL requests matching a hostname and allow it to add HTTP request headers. Something like "plugins for the curl plugin". Maybe like this:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to update the SoundCloud plugin and modified src/playlist/plugins/SoundCloudPlaylistPlugin.cxx
static void
soundcloud_parse_json((const char *url, Yajl::Handle &handle, Mutex &mutex)
{
Curl::Headers headers;
headers.insert({"accept", "application/json; charset=utf-8"});
headers.insert({"Authorization", "OAuth " + token});
auto input_stream = OpenCurlInputStream(url, headers, mutex);
Yajl::ParseInputStream(handle, *input_stream);
}
Token is read at soundcloud_init() from mpd.conf code adds tracks to queue but added tracks are skipped. SoundCloud expects OAuth token in request header for song. I am not sure to implement such a feature in a resonable way. Add some kind of "Auth: SoundCloud" property to song and let libcurl plugin take care of the rest?
Beta Was this translation helpful? Give feedback.
All reactions