简体   繁体   English

如何使用Soundcloud API下载轨道?

[英]How download track with Soundcloud API?

i want to download track from Soundcloud using Soundcloud SDK v3 我想使用Soundcloud SDK v3从Soundcloud下载曲目

<script src="https://connect.soundcloud.com/sdk/sdk-3.0.0.js"></script>

i retrive tracks from website normaly using this script (javascript) 我通常使用此脚本从网站检索曲目(javascript)

SC.get('/tracks',{
        original_format: 'mp3',
        sharing: 'public',
        streamable: true,
        downloadable: true,
        state: 'finished',
        track_type: 'original'
    }).then(function(tracks) {

    var html = '';
    $.each(tracks, function(index, track){
        html += previewTrack(track);
    });

    $('#tracks-wrapper').append(html).hide().fadeIn();
    $('.icon-refresh','#refresh-btn').removeClass('fa-spin');
});

my tracks playing fine, but i dont know how download them from soundcloud via API. 我的曲目播放正常,但是我不知道如何通过API从soundcloud下载它们。 For example i get this response from website when i play track using SDK. 例如,当我使用SDK播放曲目时,我会从网站获得此响应。

attachments_uri: "https://api.soundcloud.com/tracks/259412502/attachments"
download_count: 0
download_url: "https://api.soundcloud.com/tracks/259412502/download"
downloadable: true

finally my problem is how i can download this track .. if i use this download_url on browser, its not working 最后,我的问题是我如何下载此曲目..如果我在浏览器上使用此download_url ,则无法正常工作

Please help me.. 请帮我..

sorry about my english.. 对不起我的英语。

You need to add your client id, otherwise you won't be authorized to download it. 您需要添加客户ID,否则您将无权下载它。 https://api.soundcloud.com/tracks/259412502/download?client_id=CLIENT_ID https://api.soundcloud.com/tracks/259412502/download?client_id=CLIENT_ID

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM