Post

Replies

Boosts

Views

Activity

MusicKit playlist creation fails when number of songs is too large
I'm creating a playlist using the MusicKit endpoint and its failing with a generic error when I give it too many songs. [DataRequesting] Failed to perform MusicDataRequest.Context(  url: "https://api.music.apple.com/v1/me/library/playlists",  currentRetryCounts: [.other: 1] ) with MusicDataRequest.Error(  status: 500,  code: 50001,  title: "Upstream Service Error",  detailText: "Service failure: Cloud Library",  id: "NX5X43DEV3KH5NEK3Q7CEHJENM",  originalResponse: MusicDataResponse(   data: 153 bytes,   urlResponse: <NSHTTPURLResponse: 0x0000000280220080>  ) ). I tried setting a maximum of 500 songs and the request succeeded. Is there a known limit to how many songs can be added at once?
1
0
1.4k
Dec ’22
MusicKit MusicCatalogResourceRequest for artists with top-songs returns 504 in non-json format
I'm making a request to get 10 artists with their top songs at once, but for some artists it will always fail with a 504. The response is also in HTML which leads to a decoding error. This is my code var request = MusicCatalogResourceRequest<Artist>(matching: \.id, memberOf: ids) request.properties = properties let response = try await request.response() where ids is MusicItemId. Below I have an input which will always fail 100% of the time, even when retried. 10 elements  - 0 : "51639"  - 1 : "331584"  - 2 : "120199"  - 3 : "45058"  - 4 : "284786497"  - 5 : "44984"  - 6 : "37299"  - 7 : "518462"  - 8 : "39525"  - 9 : "73568" Example response: [DataRequesting] Failed to parse body of response with status code Unknown (504):  <!DOCTYPE html> <html lang="en"> <head>   <style>     body {       font-family: "Helvetica Neue", "HelveticaNeue", Helvetica, Arial, sans-serif;       font-size: 15px;       font-weight: 200;       line-height: 20px;       color: #4c4c4c;       text-align: center;     }     .section {       margin-top: 50px;     }   </style> </head> <body> <div class="section">   <h1>&#63743;</h1>   <h3>Gateway Timeout</h3>   <p>Correlation Key: WFRI6Q5HXAUJYXGNRKQ6YTBYIM</p> </div> </body> </html> I have also tried batching these into 2 requests of 5 artists instead of 1 request of 10 artists which still fails. However, I do have sets of 10 artists that work fine. Anyone know why?
3
1
2.3k
Jan ’23