How to remove% 3F among others from the result?

0

This is my first attempt at programming, I saw in a site a link that when I bookmark it would serve to download a video from youtube that only in mp3 format, however it did not work, when trying I understood why and tried to fix, I could do partially because in the result the symbols appear in the form of code and I can do nothing to remove it

javascript:(function() {if (location.href.indexOf('youtube.com') > -1) {window.open('http://youtubeplaylist-mp3.com/download/index/' + encodeURIComponent(location.href) .replace("https", "") .replace("youtube", "") .replace("www.", "") .replace(".com", "") .replace("watch", "") .replace(/[%3A]/, '') .replace("", "") .replace("", ""));} else {alert('So funciona no youtube carambola');}})();

asked by anonymous 07.01.2017 / 23:08

1 answer

0

You can use the function: decodeURIComponen. Here is a simple example:

var texto = "%3F%3F%3F";
alert(decodeURIComponent(texto));
    
08.01.2017 / 00:55