LiteTube

Hide video recommendations from listing and remove annoying auto-mix playlists to reduce lag and improve performance

2025-11-08 기준 버전입니다. 최신 버전을 확인하세요.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         LiteTube
// @namespace    http://tampermonkey.net/
// @version      v1.2
// @description  Hide video recommendations from listing and remove annoying auto-mix playlists to reduce lag and improve performance
// @author       Liminality Dreams
// @match        https://www.youtube.com/*
// @icon         https://img.icons8.com/?size=100&id=62852&format=png&color=228BE6
// @grant        none
// @run-at       document-start
// @license GNU 3.0
// ==/UserScript==

(function() {
    'use strict';

    let hasReloaded = false;

    function isAutoMix(listId) {
        if (!listId) return false;
        return listId.startsWith('RD') && !listId.startsWith('RDMM') && !listId.startsWith('RDAO') && !listId.startsWith('RDCLAK') && !listId.startsWith('RDTM') && !listId.startsWith('RDEM') && !listId.startsWith('RDPN');
    }

    function isWatchPage() {
        return window.location.pathname === '/watch';
    }

    function checkAndReload() {
        if (!isWatchPage() || hasReloaded) return;

        const url = new URL(window.location.href);
        const listParam = url.searchParams.get('list');

        if (listParam && isAutoMix(listParam)) {
            hasReloaded = true;
            url.searchParams.delete('list');
            url.searchParams.delete('start_radio');
            url.searchParams.delete('index');
            window.location.replace(url.toString());
        }
    }

    function removeWatchPageSidebar() {
        if (!isWatchPage()) return;
        document.querySelectorAll('#secondary').forEach(el => el.remove());
        document.querySelectorAll('ytd-watch-next-secondary-results-renderer').forEach(el => el.remove());
    }

    function removeBloat() {
        const bloatSelectors = [
            'ytd-rich-shelf-renderer[is-gaming]',
            'ytd-statement-banner-renderer',
            'ytd-banner-promo-renderer',
            'ytd-compact-promoted-video-renderer',
            'ytd-display-ad-renderer',
            'ytd-promoted-sparkles-web-renderer'
        ];
        bloatSelectors.forEach(selector => {
            document.querySelectorAll(selector).forEach(el => el.remove());
        });
    }

    const style = document.createElement('style');
    style.textContent = `
        body[is-watch-page] #secondary,
        body[is-watch-page] ytd-watch-next-secondary-results-renderer,
        ytd-playlist-panel-renderer,
        .ytp-playlist-menu {
            display: none !important;
        }
    `;
    document.head.appendChild(style);

    checkAndReload();

    const observer = new MutationObserver(() => {
        if (isWatchPage()) {
            removeWatchPageSidebar();
        }
        removeBloat();
    });

    const startObserver = () => {
        if (document.body) {
            observer.observe(document.body, {
                subtree: true,
                childList: true
            });
        }
    };

    if (document.body) {
        startObserver();
    } else {
        document.addEventListener('DOMContentLoaded', startObserver);
    }

    window.addEventListener('yt-navigate-finish', () => {
        hasReloaded = false;
        checkAndReload();
        if (isWatchPage()) {
            setTimeout(removeWatchPageSidebar, 100);
        }
    });

})();