一応
var shorturl = new java.net.URL(urls[w].replace(/<br>|\s| /, ''));
var longurl = (v2c.expandShortURL(shorturl, true)+'').replace(/http/i, 'ttp');
と
var shorturl = new java.net.URL(urls[w]);
var longurl = (v2c.expandShortURL(shorturl, true)+'').replace(/http/i, 'ttp');