有没有快速的方法可以在soundcloud上获取曲目或播放列表的api url?
例如此播放列表的api链接:
https://soundcloud.com/thump/sets/thump-x-avolta-5
是:
https%3A//api.soundcloud.com/playlists/40626677
和此曲目的api链接:
https://soundcloud.com/larryfisherman/the-star-room-og-version
是:
https%3A//api.soundcloud.com/tracks/154949628
这是我对vimeo链接的代码。
if($tvideo === "Vimeo"){
$Vimeo = "html('<iframe src=\"//player.vimeo.com/video/" . $video . "?color=bc2122\" width=\"700\" height=\"525\" frameborder=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>');";
}
在表格中我有$tvideo
(视频类型)。
并$video
来自网址的代码,例如:
https://vimeo.com/83528019
号码:
83528019
我想用soundcloud做同样的事情,但嵌入式html非常奇怪†所以不是找到号码(对于vimeo案例)我需要找到api url。
†:
html('<iframe width=\"720\" height=\"500\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/150885898&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&visual=true\"></iframe>');
答案 0 :(得分:2)
http://developers.soundcloud.com/docs/api/reference#resolve会有帮助吗?
$ curl -v&#39; http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/matas/hobnotropic&client_id=YOUR_CLIENT_ID&#39;
&LT; HTTP / 1.1 302暂时移动 &LT;地点:http://api.soundcloud.com/tracks/49931.json