1

I've been looking at the MusicKit functionality for playlists: https://developer.apple.com/documentation/applemusicapi/create_a_new_library_playlist

I'm wondering, can anyone confirm if they have been able to:

  • remove songs from an existing playlist
  • delete a playlist
  • update the title of a playlist

For example, I have tried updating the title of a playlist in c# using the following but the endpoint does exist/accept this. Note the appended playlist ID to the POST URL p.ABC123

using (var client = new HttpClient())
{
    client.DefaultRequestHeaders.Add("Authorization", "Bearer " + [MYDEVTOKEN]);
    client.DefaultRequestHeaders.Add("Music-User-Token", [MYMUSICUSERTOKEN]);


    string _postUri = "https://api.music.apple.com/v1/me/library/playlists/p.ABC123";

    var jsonObject = JObject.FromObject(new
        {
            attributes = new
            {
                name = "Playlist - Edited Title",
                 description = "This is a playlist edit"
            }
        });

        var _content = new StringContent(jsonObject.ToString(), Encoding.UTF8, "application/json");

        var response = await client.PostAsync(_postUri, content: _content);

        string outputContent = await response.Content.ReadAsStringAsync();

} 
4

1 回答 1

3

似乎 Apple 不允许使用此功能。

https://forums.developer.apple.com/thread/107807

他们可能会这样做作为安全预防措施。然而,Apple 与开发者社区的关系并不好,而且很可能这样做是为了限制人们在他们的应用程序之上构建应用程序。(即使它们是一个非常昂贵的 API,可以立即使用......)

我预计不会很快获得此功能:(

于 2019-12-09T23:31:12.183 回答