Skip to content

Instantly share code, notes, and snippets.

@vinaysolanki
Last active April 12, 2025 11:42
Show Gist options
  • Select an option

  • Save vinaysolanki/5484971 to your computer and use it in GitHub Desktop.

Select an option

Save vinaysolanki/5484971 to your computer and use it in GitHub Desktop.
Increase Youtube view count with this JS code Usage: Play a video and open console in chrome and enter increaseCount(views,interval) Eg: increaseCount(2000,10)
var z=0;
var newcount;
function increaseCount(views,interval){
setTimeout(function(){
var viewcount = document.getElementById("watch7-views-info").children[0].innerHTML;
newcount = parseInt(viewcount.replace(',','').replace(',',''));
newcount++;
document.getElementById("watch7-views-info").children[0].innerHTML = addCommas(newcount);
z++;
if (z < views){
increaseCount(views,interval);
}
},interval);
}
function addCommas(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
@zubypk

zubypk commented Apr 22, 2022

Copy link
Copy Markdown

Do we need to copy whole script and paste it in the console and then call the function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment