Automate the process of youtube comments

105 0 0 0

Last Updated : 2021-05-18 13:08:01

This script runs in an extension that will automate the process of commenting on any video.

    //--------------------------- YOUTUBE ONE VIDEO
if(currentURL.startsWith('https://www.youtube.com/watch?v=') ) {

alert('YES OF COURSE');
console.log('YES OF COURSE');

var theComment = 'ماشاء الله - فيديو مفيد جدا - ربنا يبارك لحضرتك';


setTimeout(function(){

window.scrollTo(0,500);

setTimeout(function(){

//Now foduc on the input -> this is very important
$("yt-formatted-string#simplebox-placeholder").focus();

//Now add the comment
$("div#contenteditable-root").text(theComment);

//Now Activate the submit button
$("ytd-button-renderer#submit-button.style-scope.ytd-commentbox.style-primary.size-default").removeAttr('disabled');
$("ytd-button-renderer#submit-button.style-scope.ytd-commentbox.style-primary.size-default > a").removeAttr('disabled');


//Now Click the submit button
$("ytd-button-renderer#submit-button").click();

/* setTimeout(function(){
$("ytd-button-renderer#submit-button").click();
}, 5000); */

}, 5000);


//alert('DOnE');

}, 2000);


}

Mohammed Anwar

Mohammed Anwar

Experienced technical lead PHP, MySQL and Laravel Developer for 15+ years, with proven ability to develop and create high-quality and optimized web applications. Great ability to build and optimize database design, schema and queries. Versed programing trainer and instructor delivering web courses and helping others to get into the field in a timely manner. Fast and eager learner for new technologies .