watchporn.to Video Src Extractor

Retrieves the video src URL from the page's source code.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         watchporn.to Video Src Extractor
// @version      1.0
// @description  Retrieves the video src URL from the page's source code.
// @author       https://github.com/matthewseat449
// @match        https://watchporn.to/*
// @grant        none
// @license      MIT
// @namespace https://greasyfork.org/users/1442738
// ==/UserScript==

// userscript that just opens a JS alert on pageload, and contains the video SRC / source. Sometimes just needs a refresh of the page and it will work. 

(function() {
    'use strict';

    // Run the script as soon as the DOM is fully loaded
    window.onload = function() {
        // Find all video elements on the page
        const videoElements = document.querySelectorAll('video');

        if (videoElements.length > 0) {
            videoElements.forEach((videoElement, index) => {
                if (videoElement.src) {
                    const videoSrc = videoElement.src;
                    console.log(`Video source #${index + 1} found:`, videoSrc);

                    // Show the video source in an alert window
                    alert(`Video source #${index + 1} found: ${videoSrc}`);
                } else {
                    console.log(`Video element #${index + 1} has no src attribute.`);
                }
            });
        } else {
            console.log('No video elements found on this page.');
            alert('No video elements found on this page.');
        }
    };
})();