2016-04-24 172 views
0

我想在我的網頁上播放Soundcloud歌曲。我只是試圖使用API​​進行測試,但我似乎沒有得到任何地方。任何想法我做錯了什麼? Soundcloud將授權我,並將爲該歌曲顯示一個對象,但不會播放該歌曲。不確定如何查找更多信息,初學者的信息很難找到或不起作用。嘗試從developers.soundcloud.com執行此操作無法在我的網頁上播放Soundcloud歌曲

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); 
}); 

回答

0

這是因爲API不允許您獲取曲目內容。不幸的是,這從文檔中不是很清楚。也不清楚何時允許通過API訪問曲目,何時不可以。

查找道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.

此人被允許不403錯誤進行訪問,我喜歡它的標題:https://soundcloud.com/paradoxeodstl/error-403-prod-boxinwoxin

相關問題