Youtube

Remove youtube videos

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Youtube
// @namespace    https://github.com/Shelicus
// @version      1.0
// @description  Remove youtube videos
// @author       Shelicus
// @match        https://www.youtube.com/*
// @exclude      *://*.youtube.com/channel/*
// @exclude      *://*.youtube.com/c/*
// @license      CC
// @grant        none
// @run-at document-start
// ==/UserScript==

(function() {
    'use strict';
    var intvl, intvl2, intvl3, startToAppend = 4000, loop = 5000, loopse = 500;
    //startToAppend -> Time for wait till YouTube classes load;
   
    //legt neues Element an im Script
    setTimeout(appendElement, startToAppend);
    
    //Aufruf der Funktion 1
    intvl = setInterval(function(){
        removeEndScreens("ytp-ce-element");
    },loop);

    //Aufruf der Funktion 2
    intvl2 = setInterval(function(){
        removevideos("div#items.style-scope.ytd-watch-next-secondary-results-renderer");
    },loopse);

    //Aufruf der Funktion 3
    intvl3 = setInterval(function(){
        removevideosstartseite("contents");
    },loopse);
    //loop = check interval for new End-Screens;

    //Anlegen eines Neuen Elements -> Eigentlich nicht mehr von nöten
    function appendElement() {
        var el = document.createElement("span");
        el.id = "removed_ess";
        el.style.textAlign = "center";
        document.getElementsByClassName("style-scope ytd-video-secondary-info-renderer")[1].appendChild(el);
    }

    //Funktion zu löschung der Verlinkten Videos am Ende des Video
    function removeEndScreens(className){
        var elements = document.getElementsByClassName(className);
        while(elements.length > 0){
            if(elements[0].parentNode.removeChild(elements[0])){
                console.log("Found ES");
                 }
            else{
                console.log("Not found ES yet");
            }
        }
    }

    //Funktion zu löscung der Videos Unterhalb des Videos
    function removevideos(Name){
        var elemento;
        elemento = document.querySelectorAll(Name)
        if(elemento.length > 0){
             elemento[0].remove();
        }
     }

    //Funktion zur löscung der Videos auf der Startseite
    function removevideosstartseite(ClassName){
        var elementozwe;
        elementozwe = document.querySelectorAll('div#contents[class="style-scope ytd-rich-grid-renderer"]')
        if(elementozwe.length > 0){
            elementozwe[0].remove();
         }
    }
})();