YouTube Subs List Filter

Hide your subs that have no uploads, no more hunting! Also links you directly to the videos page. Also cuts out polymer videos that you have already watched or watch-latered.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         YouTube Subs List Filter
// @namespace    http://ejew.in/
// @version      0.3
// @description  Hide your subs that have no uploads, no more hunting! Also links you directly to the videos page. Also cuts out polymer videos that you have already watched or watch-latered.
// @author       EntranceJew
// @match        https://www.youtube.com/*
// @grant        none
// ==/UserScript==

(function() {
    var checkExist = setInterval(function() {
        var i = 0;
        var subsContainer = document.querySelector('a.yt-simple-endpoint[href="/feed/channels"]');
        if( subsContainer ){
            var ourSubs = subsContainer.parentElement.parentElement.nextElementSibling;
            // hide things we don't care about
            var subs = ourSubs.querySelectorAll(".guide-entry-count[hidden]");

            if( subs.length ){
                for (i = 0; i < subs.length; ++i) {
                    subs[i].parentNode.parentNode.hidden = true;
                }
            }

            var links = ourSubs.querySelectorAll('ytd-guide-entry-renderer>a[href^="/channel/"]:not([name$="/videos"])');

            if( links.length ){
                for (i = 0; i < links.length; ++i) {
                    links[i].href += "/videos";
                }
            }
        }

        var videos = document.querySelectorAll('.ytd-shelf-renderer ytd-thumbnail-overlay-resume-playback-renderer .ytd-thumbnail-overlay-resume-playback-renderer[style="width: 100%;"]');

        if( videos.length ){
            for (i = 0; i < videos.length; ++i) {
                videos[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.hidden = true;
            }
        }

        var added = document.querySelectorAll('.ytd-shelf-renderer ytd-thumbnail-overlay-toggle-button-renderer[aria-label="Added"]');

        if( added.length ){
            for(i = 0; i < added.length; ++i) {
                added[i].parentNode.parentNode.parentNode.parentNode.parentNode.hidden = true;
            }
        }
    }, 100); // check every 100ms
})();