首页 > 代码库 > [No0000F1]js获取喜马拉雅和荔枝FM电台专辑音频

[No0000F1]js获取喜马拉雅和荔枝FM电台专辑音频

荔枝FM小书签.txt

javascript: (function() {    if ($(‘#down_url‘)) {        $(‘#down_url‘).remove();    };    $(document.body).prepend(‘<div id="down_url"></div>‘);    $(‘#down_url‘).append(‘共 ‘ + $(‘.album_soundlist ul li‘).length + ‘ 个音频‘ + ‘<br>‘);    for (var i = 0; i < localStorage.length; i++) {        var strs = new Array();        strs[i] = localStorage.getItem(localStorage.key(i));        strs[i] = eval(‘(‘ + strs[i] + ‘)‘);        if (strs[i].isPlaying != null) {            $(‘#down_url‘).prepend(‘<a href="http://www.mamicode.com/‘ + strs[i].url + ‘" target="_blank">‘ + strs[i].url + ‘</a>  ‘ + strs[i].userName + ‘-‘ + strs[i].title + ‘<br/>‘);        };    };})();

 喜马拉雅FM小书签.txt

javascript: (function() {    if ($(‘#down_url‘)) {        $(‘#down_url‘).remove();    };    $(document.body).prepend(‘<div id="down_url"></div>‘);    $(‘#down_url‘).append(‘共 ‘ + $(‘.album_soundlist ul li‘).length + ‘ 个音频‘ + ‘<br>‘);    $(‘.album_soundlist ul li‘).each(function(i) {        var sound_id = $(this).attr(‘sound_id‘);        var json_url = ‘http://www.ximalaya.com/tracks/‘ + sound_id + ‘.json‘;        $.get(json_url,        function(json) {            var save_name = json.nickname + ‘-‘ + json.title;            var down_cmd = save_name + ‘&nbsp;&nbsp;‘ + ‘<a href="http://www.mamicode.com/‘ + json.play_path_64 + ‘" target="_blank">‘ + json.play_path_64 + ‘</a><br/>‘;            jQuery(‘#down_url‘).append(down_cmd);        });    });})();

 技术分享

[No0000F1]js获取喜马拉雅和荔枝FM电台专辑音频