function addJQuery(callback) { var script = document.createElement("script"); script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); script.addEventListener('load', function() { var script = document.createElement("script"); script.textContent = "(" + callback.toString() + ")();"; document.body.appendChild(script); }, false); document.body.appendChild(script); }
input:hidden
selector, I saw that those of them contain the required link have an id corresponding to the audio_info * mask. Improve the selector a bit. input:hidden[id*='audio']
gets only the inputs we need.
$('input:hidden[id*="audio"]').each(function () {
url=$(this).attr('value').split(',')[0];
console.log("wget "+url);
});
, feed them to wget-y, and get at the output ... Hash in file names, because Not all songs have idv3 tags, and the file name after downloading consists of the symbols a..z and 0..9 without a hint of the artist or track name. Vooschem, just go file on the server. Therefore, we will continue.
$('input:hidden[id*="audio"]').each(function () { url=$(this).attr('value').split(',')[0]; author=$(this).parent().parent().parent().find('b').find('a[href*="search"]').html(); song=$(this).parent().parent().parent().find('span[id*="title"]').html(); console.log('wget -O "'+author+'-'+song+'.mp3" '+url); });
Source: https://habr.com/ru/post/143406/