Youtube Redirect v0.3

🧩 Syntax:
// ==UserScript==
// @name         Redirect to Yewtu.be
// @version      0.3
// @description  Redirects YouTube video links to Yewtu.be
// @author       Pirate
// @match        https://www.youtube.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    function checkAndRedirect() {
        var currentUrl = window.location.href;

        // Check if the URL contains "/watch"
        if (currentUrl.includes('/watch')) {
            var newURL = currentUrl.replace('https://www.youtube.com/watch', 'https://yewtu.be/watch');
            window.location.href = newURL;
        }
    }

    // Check and redirect every 5 seconds (adjust the interval as needed)
    setInterval(checkAndRedirect, 5000);
})();