• BaroqueInMind@lemmy.one
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    3 days ago

    Delete this, YouTube will catch on and block this workaround.

    Edit: disregard. Here is a custom GreaseMonkey/ViolentMonkey userscript to automatically do this for you:

    // ==UserScript==
    // @name         YouTube to Embed Redirect (Desktop & Mobile)
    // @namespace    http://tampermonkey.net/
    // @version      1.1
    // @description  Redirects YouTube video URLs (desktop and mobile) to their embed version.
    // @author       BaroqueInMind
    // @match        https://www.youtube.com/watch?v*
    // @match        https://m.youtube.com/watch?v*
    // @grant        none
    // ==/UserScript==
    
    (function() {
        'use strict';
    
        // Extract the video ID from the URL
        const videoId = new URLSearchParams(window.location.search).get('v');
    
        if (videoId) {
            // Redirect to the embed URL
            window.location.href = `https://www.youtube.com/embed/$%7BvideoId%7D`;
        }
    })();