Xrares priv video view

see xrares priv videos

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

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