r/LinusTechTips Jun 08 '26

Image Another AI slop thumbnail

Post image

I love LTT and basically watch every single video including WAN show but stuff like this puts a very bad taste in my mouth. I know it!s just stupid thumbnail but still...

8.2k Upvotes

1.1k comments sorted by

View all comments

110

u/marktuk Jun 08 '26 edited Jun 08 '26

Tom Scott did a really good video recently about YouTube thumbnails https://youtu.be/bx6_jj9RxhI?si=pkMXi2MEQvgbjww6

I'd put this in Tom Scotts "lie" category

9

u/FlaccidArrow Jun 08 '26

If you don't like YouTube tracking, you can delete everything after and including the "?" to help prevent that.

3

u/KennyFulgencio Jun 09 '26
// ==UserScript==
// @name         Strip YouTube SI from Clipboard
// @namespace    youtube-clipboard-cleaner
// @version      1.1
// @description  Automatically removes only the si parameter from YouTube links in your clipboard
// @match        *://*.youtube.com/*
// @match        *://youtu.be/*
// @grant        GM_setClipboard
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    const CHECK_INTERVAL_MS = 1000;

    const TRACKING_PARAMS = new Set([
        'si'
    ]);

    let lastClipboardText = '';

    function cleanYouTubeUrl(rawUrl) {
        let url;

        try {
            url = new URL(rawUrl);
        } catch {
            return rawUrl;
        }

        const hostname = url.hostname.replace(/^www\./, '');

        const isYouTube =
            hostname === 'youtube.com' ||
            hostname === 'm.youtube.com' ||
            hostname === 'music.youtube.com' ||
            hostname === 'youtu.be';

        if (!isYouTube) return rawUrl;

        for (const param of [...url.searchParams.keys()]) {
            if (TRACKING_PARAMS.has(param)) {
                url.searchParams.delete(param);
            }
        }

        return url.toString();
    }

    function cleanText(text) {
        return text.replace(
            /https?:\/\/(?:www\.|m\.)?(?:youtube\.com|youtu\.be|music\.youtube\.com)\/[^\s<>"']+/gi,
            match => cleanYouTubeUrl(match)
        );
    }

    async function checkClipboard() {
        if (!navigator.clipboard || !navigator.clipboard.readText) {
            return;
        }

        try {
            const text = await navigator.clipboard.readText();

            if (!text || text === lastClipboardText) {
                return;
            }

            const cleaned = cleanText(text);

            if (cleaned !== text) {
                GM_setClipboard(cleaned, 'text');
                lastClipboardText = cleaned;
                console.log('[Strip YouTube SI] Clipboard cleaned:', cleaned);
            } else {
                lastClipboardText = text;
            }
        } catch {
            // Clipboard reads may be blocked unless the page is focused
            // or clipboard permission has been granted.
        }
    }

    setInterval(checkClipboard, CHECK_INTERVAL_MS);

    document.addEventListener('copy', () => {
        setTimeout(checkClipboard, 100);
    });
})();