var ext = ".mp3"
var links = [];
Array.prototype.map.call(
document.querySelectorAll('a[href$="' + ext + '"]'),
function(e, i) {
if ((links || []).indexOf(e.href) == -1) links.push(e.href);
});
var text = links.join("n");
console.log(text);