วิธีป้องกันไม่ให้ YouTube แสดงวิดีโอที่ดูแล้ว?


12

มีวิธีป้องกันไม่ให้ YouTube แสดงวิดีโอที่ดูแล้วในรายการวิดีโอที่แนะนำหรือไม่


1
ภาพรวมของ HTML อย่างรวดเร็วทำให้ฉันคิดว่าไม่ควรทำยากเกินไป โดยทั่วไปคุณต้องการตั้งค่าองค์ประกอบdisplay: noneใด ๆ<ytd-compact-video-renderer>ที่มีองค์ประกอบ#progressย่อย คุณจะไม่สามารถทำได้ใน CSS แต่สคริปต์ Tampermonkey ควรจะง่ายพอ ฉันจะไปทีหลังแล้วเขียนคำตอบ ...
Aaron F

คำตอบ:


12

ปัจจุบันยังไม่มีวิธีการรักษา / วิธีแก้ปัญหา นอกเหนือจากการบล็อกด้วยตนเองทีละคนไม่มีวิธีแก้ปัญหาที่ปรับขนาดได้

0

แต่มีส่วนขยายที่สามารถทำได้เช่น:


// ==UserScript==
// @version        1.1.1
// @name           Hide watched videos on YouTube
// @namespace      https://gist.github.com/xPaw/6324624
// @match          https://www.youtube.com/*
// @updateURL      https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js
// @downloadURL    https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js
// @grant          none
// ==/UserScript==

const app = document.querySelector( 'ytd-app' );

function HideVideos( a )
{
    app.querySelectorAll( 'ytd-thumbnail-overlay-resume-playback-renderer:not([data-hidden="true"])' ).forEach( element =>
    {
        element.dataset.hidden = true;

        while( ( element = element.parentNode ).tagName.toLowerCase() !== 'ytd-item-section-renderer' )
        {
            // Find the container element for this video
        }

        element.hidden = true;
    } );
}

function ProcessPage()
{
    if( !window.location.pathname.startsWith( '/feed/subscriptions' ) )
    {
        return;
    }

    const list = app.querySelector( 'ytd-section-list-renderer' );

    if( list.dataset.hooked )
    {
        return;
    }

    list.dataset.hooked = true;
    list.addEventListener( 'yt-next-continuation-data-updated', HideVideos );

    // TODO: Find an event to fix this
    new MutationObserver( HideVideos ).observe( list, { childList: true, subtree: true } );
}

app.addEventListener( 'yt-navigate-finish', ProcessPage );

ProcessPage();

3
นั่นเป็นความอัปยศ ฉันได้รับมิวสิควิดีโอที่เหมือนกัน ~ โหลตลอดเวลา แต่การปิดกั้นพวกเขาทั้งหมดนั้นเกินความจริง
JollyJoker

1
โอ้ดีคุณอัปเดตด้วย userscript แล้ว! :-)
Aaron F

บางคนไม่ทำงาน แต่นี่คือสิ่งที่ฉันกำลังมองหา Tks
DGaleano

โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.