无法在我的网页上播放Soundcloud歌曲

时间:2016-04-24 03:24:36

标签: soundcloud

我正在尝试在我的网页上播放Soundcloud歌曲。我只是想尝试使用API​​测试,但我似乎无处可去。知道我做错了什么吗? Soundcloud将授权我并将显示该歌曲的对象,但不会播放它。不知道如何查找更多信息,初学者的信息很难找到或不起作用。尝试从developers.soundcloud.com

执行此操作
SC.initialize({
  client_id: 'entered my id from the registered app here'
});

var track_url = 'https://soundcloud.com/aviciiofficial/hope-theres-someone-1';
SC.oEmbed(track_url, { auto_play: true }).then(function(oEmbed) {
  console.log('oEmbed response: ', oEmbed);
});

1 个答案:

答案 0 :(得分:0)

This is because the API does not allow you to get the track contents. Unfortunately this is not very clear from the documentation. Nor is it very clear when a track is allowed to be accessed through the API and when it's not.

Find the track id:

curl "https://api.soundcloud.com/resolve?url=https://soundcloud.com/aviciiofficial/hope-theres-someone-1&client_id=..." {"status":"302 - Found","location":"https://api.soundcloud.com/tracks/255863316?client_id=..."}

wget "https://api.soundcloud.com/tracks/255863316?client_id=..." --2016-04-25 11:05:01-- https://api.soundcloud.com/tracks/255863316?client_id=... Resolving api.soundcloud.com... 93.184.220.127 Connecting to api.soundcloud.com|93.184.220.127|:443... connected. HTTP request sent, awaiting response... 403 Forbidden 2016-04-25 11:05:01 ERROR 403: Forbidden.

This one is allowed to be accessed without a 403 error, and I liked the title of it: https://soundcloud.com/paradoxeodstl/error-403-prod-boxinwoxin