xrares.com Video Finder

Scan for video URL on xrares.com video pages using the evideo_vkey variable and check for multiple resolutions, IE retrieves the video link of private videos.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         xrares.com Video Finder
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Scan for video URL on xrares.com video pages using the evideo_vkey variable and check for multiple resolutions, IE retrieves the video link of private videos.
// @author       ErickCHIN
// @match        http*://*.xrares.com/video/*
// @grant        GM_xmlhttpRequest
// @grant        GM_notification
// @connect      *
// @run-at       document-end
// ==/UserScript==

(function () {
    'use strict';

    // Wait for the document to be ready
    $(document).ready(function () {

        const videoElement = document.getElementById('vjsplayer_html5_api');
        if (videoElement) {
            return;
        }
        // Extract the video ID from the URL
        const videoId = window.location.pathname.split('/')[2]; // e.g. "36708"

        // Find the evideo_vkey variable
        const evideoVkeyMatch = /var evideo_vkey = "([^"]+)"/.exec(document.body.innerHTML);
        if (!evideoVkeyMatch) {
            alert("Could not find evideo_vkey in page.");
            return;
        }
        const evideoVkey = evideoVkeyMatch[1];

        // Define the base URL and resolutions to check
        const domain = "https://www.xrares.com";
        const basePath = "/vsrc/h264/";
        const resolutions = ["HD", "SD", "1440p", "1080p", "720p", "640p", "480p", "360p", "240p", "144p"];

        let found = false;

        // Try each resolution
        for (let resolution of resolutions) {
            const url = `${domain}${basePath}${evideoVkey}/${resolution}`;
            console.log(url)

            GM_xmlhttpRequest({
                method: 'HEAD',
                url: url,
                timeout: 5000,
                onload: function (response) {
                    if (response.status === 200 && !found) {
                        found = true;
                        alert("✅ Video found:\n" + url);
                    }
                },
                onerror: function () {}
            });
        }

        // After all requests, check if not found
        setTimeout(() => {
            if (!found) {
                alert("❌ Video not found.");
            }
        }, 10000); // Wait 10 seconds for all HEAD requests
    });
})();