我使用简单端点/tracks/
通过API获取曲目信息。这适用于大多数曲目,但对于一些我得到403错误。
例如this one无效:
http://api.soundcloud.com/tracks/232273455?client_id=<clientID>
返回:
HTTP/1.1 403 Forbidden
Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
Access-Control-Allow-Methods: GET, PUT, POST, DELETE
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Date
Cache-Control: max-age=600, public
Cache-Control: private, max-age=0
Content-Length: 0
Content-Type: application/json; charset=utf-8
Date: Sat, 09 Apr 2016 09:39:00 GMT
Etag: "5a8b3e5cf857d1c73a6ec924804140e1"
Server: am/2
Status: 200 OK
Vary: Authorization, Accept
但是这个可以使用相同的客户端ID:
http://api.soundcloud.com/tracks/169170570?client_id=<clientID>
返回:
HTTP/1.1 200 OK
Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
Access-Control-Allow-Methods: GET, PUT, POST, DELETE
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Date
Cache-Control: max-age=600, public
Content-Encoding: gzip
Content-Length: 765
Content-Type: application/json; charset=utf-8
Date: Sat, 09 Apr 2016 09:34:39 GMT
Etag: "0e64b4946489f72918940be1c559f1ee"
Server: am/2
Status: 200 OK
Vary: Authorization, Accept
{
"artwork_url": "https://i1.sndcdn.com/artworks-000098499957-8mkrc3-large.jpg",
"attachments_uri": "https://api.soundcloud.com/tracks/169170570/attachments",
"bpm": null,
"comment_count": 2015,
"commentable": true,
"created_at": "2014/09/24 15:23:54 +0000",
"description": "Urban Flora\n\n@galimatias\n\nCover art by: Oska \nhttp://instagram.com/oskadesign",
"download_count": 0,
.....
我不知道这是技术问题,还是用户可能设置了一些禁止嵌入的选项?或某些版权问题?
在soundcloud页面上,嵌入链接正在运行......:
无论如何,有更详细的回复会很棒,403意味着Forbidden
,但为什么呢?