Xrares priv video view

see xrares priv videos

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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

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

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

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

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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.

(I already have a user style manager, let me install it!)

// ==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
    });
})();