Greasemonkey script to click the “Load More” button of YouTube video pages

YouTube forces its content creators to create lots of videos than is necessary. I have been watching the drawing videos of an artist. She is now posting videos every day, not about drawing but about her everyday activities. In these videos, she posts links to the real drawing videos or tells about them in advance. It’s awful. She is not alone. There are lots of people who seem to be doing this. There was this one guy whose electronics videos I watched a few times. I decided to check what else he had posted. Yikes! A whole lot of useless nothingness videos! I didn’t see them earlier because I always change the filter to “Most popular”.

If content creators stop making such videos, YouTube lets their earnings fall. This is because only the latest videos of subscribed channels are listed when people launch the YouTube app. If a content creator does not produce at least two or three videos per week, it is easy to get hidden by other channels when he/she does release a new video after a long break.

I use bookmarks and the hidden RSS feeds of YouTube. I don’t login and I don’t watch them live. Because of unexplained lag issues, I download the videos and watch them offline on my WDTV device.

When I check the videos pages, only some video thumbnails are listed there. There is a “Load More” button, which needs to be clicked several times to get the full listing. Sometimes the Net connection breaks during this interval and the expansion of the page stops. I need to then refresh the page and then click the button a few times to get to down to where I was. So, I wrote this Greasemonkey script to that for me. I load the video page and the script automatically clicks the button several times, waiting for sometime between each click to let the videos thumbnails.

// ==UserScript==
// @name YouTube LoadMore Till No More
// @namespace
// @description Automatically expands the videoslist
// @include /https://www\.youtube\.com/(channel|user)/(\w+)/videos*/
// @exclude %exclude%
// @version 2018
// @grant none
// ==/UserScript==
var iYLM_Timeout = 0;
var iCounter = 0;
document.addEventListener("DOMContentLoaded", startItDelayed, false);
function startItDelayed() {
iYLM_Timeout = window.setTimeout(loadMore, 10*1000);
function loadMore() {
console.log("YLM: We are in");
if (document.getElementsByClassName("load-more-button").length > 0) {
if (document.getElementsByClassName("load-more-button")[0].getElementsByClassName("load-more-text").length > 0) {
console.log("YLM: Loading more " + (++iCounter));
} else if (iYLM_Timeout != 0) {
console.log("YLM: No more found ");

With this script, I open the videos page to let it roll out. Meanwhile, I browse some other page. By the time I come back to the video page, all the thumbnails are listed.

Make a comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s