JavaScript native as follows:
var links = document.getElementsByTagName("a");
for (i = 0; i < links.length; i++) {
var link = links[i];
var urlProtegida = "http://anunciad.com.br?AuID=16958&Aurl=" + link.href;
link.href = urlProtegida;
}
Or with jQuery :
$("a").each(function() {
var urlProtegida = "http://anunciad.com.br?AuID=16958&Aurl=" + $(this).attr("href");
$(this).attr("href", urlProtegida);
});
With jQuery you can make a filter to only change links whose URL contains the domain of any of the servers mentioned in your question.
// Lista de bases de URLs dos servidores.
var urlsBases = ["meocloud.pt", "mega.co.nz", "outro.servidor.com"];
for (var i = 0; i < urlsBases.length; i++) {
var serverUrlBase = urlsBases[i];
// OBS: é necessário colocar entre aspas simples a url no filtro do jQuery por atributo.
$("a[href*='" + serverUrlBase + "']").each(function() {
var urlProtegida = "http://anunciad.com.br?AuID=16958&Aurl=" + $(this).attr("href");
$(this).attr("href", urlProtegida);
});
}