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.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==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
    });
})();