🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/25 06:19:52
🔄 下次更新时间:2026/01/25 07:19:52
手动刷新缓存

YouTube Redirect

Working 2023 adblock for YouTube video. Redirects all "youtube.com" links to yout-ube.com.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         YouTube Redirect
// @description  Working 2023 adblock for YouTube video. Redirects all "youtube.com" links to yout-ube.com.
// @author       YelloNox
// @version      0.2
// @date         2023-10-10
// @namespace    https://yello.zip
// @homepage     https://github.com/YelloNox/YouTube-Adblock
// @match        *://www.youtube.com/*
// @match        *://www.yout-ube.com/*
// @match        *://www.youtube-nocookie.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';
    // Redirect clicked links to new tab and from "youtube.com" to "yout-ube.com"
    document.addEventListener('click', function (event) {
        let target = event.target;
        while (target && target.nodeName !== 'A') {
            target = target.parentElement;
        }

        if (target && target.href) {
            const youtubeVideoRegex = /https:\/\/www\.youtube\.com\/watch\?v=[^&]+/;
            if (youtubeVideoRegex.test(target.href)) {
                event.preventDefault();
                event.stopPropagation();

                const modifiedUrl = target.href.replace('youtube.com', 'yout-ube.com');
                window.open(modifiedUrl, '_blank');
            }
        }
    }, true);

    // Check for text "This video is unavailable" and reload page if found
    function checkForText() {
        const textToFind = "This video is unavailable";
        const pageText = document.body.textContent;

        if (pageText.includes(textToFind)) {
            location.reload();
        }
    }

    window.addEventListener('load', checkForText);
})();