Xrares priv video view

see xrares priv videos

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name            Xrares priv video view
// @description     see xrares priv videos
// @namespace       sebaalosrom
// @version         1.0.0
// @author          Sebastian Osses
// @license         MIT
// @match           *://*.xrares.com/*
// @homepageURL     https://sleazyfork.org/en/users/1606647-shawn-parker
// ==/UserScript==

(function () {
    'use strict';

    function procesarVideo() {
        const container = document.querySelector('.video-container');
        if (!container) return;

        const privMsg = container.querySelector('.privMSG');
        if (!privMsg) return;

        let vkey = "";
        if (typeof window.evideo_vkey !== 'undefined') {
            vkey = window.evideo_vkey;
        } else if (typeof evideo_vkey !== 'undefined') {
            vkey = evideo_vkey;
        }

        if (!vkey) {
            console.warn('[Userscript] Se encontró .privMSG pero no existe la variable evideo_vkey.');
            return;
        }

        const videoHTML = `
            <video id="vjsplayer_html5_api" controls autoplay muted style="width:100%;height:100%;" class="vjs-tech" slideimage="https://cdn.xrares.com/media/videos/vjsslides/69/69049_progressthumb.jpg" preload="auto">
                <source src="https://www.xrares.com/vsrc/h264/${vkey}/HD" type="video/mp4" label="HD" res="720">
            </video>
        `;

        container.querySelector(".col-xs-12").innerHTML = videoHTML;
    }

    procesarVideo();

    const observer = new MutationObserver((mutations, obs) => {
        const container = document.querySelector('.video-container');
        if (container && container.querySelector('.privMSG')) {
            procesarVideo();
        }
    });

    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();