XVideos Download Link Extractor

Add high resolution download link on the right of the screen. Use save as... to download the video you need.

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

You will need to install an extension such as Tampermonkey 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.

You will need to install a user script manager extension to install this script.

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

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @author          Newonroad
// @name            XVideos Download Link Extractor
// @namespace       newonroad
// @description     Add high resolution download link on the right of the screen. Use save as... to download the video you need.
// @include         http*://www.xvideos.com/video*
// @version         0.0.3
// @run-at          document-start
// @grant           none
// ==/UserScript==

(function extractXVideos() {
    window.addEventListener("DOMContentLoaded", function () {
        function createVideoDownloadElement(href, hintText) {
            var videoList = document.createElement("li");
            var videoDownloadElement = document.createElement("a");
            videoDownloadElement.setAttribute("href", href);
            videoDownloadElement.setAttribute("target", "_blank");
            videoDownloadElement.setAttribute("class", "btn btn-default");
            videoDownloadElement.setAttribute("download", window.xv.conf.dyn.id + ".mp4");
            videoDownloadElement.innerHTML = '<span class="icon download"></span><span class="visible-lg-inline"> '+hintText+'</span></a>';
            videoList.appendChild(videoDownloadElement);
            document.querySelector("#video-actions > ul").appendChild(videoList);
        }
        createVideoDownloadElement(window.html5player.url_high, "High");
        createVideoDownloadElement(window.html5player.url_low, "Low");
        createVideoDownloadElement(window.html5player.url_hls, "HLS");
    });
}());