watchporn.to Video Src Extractor

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

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 or Violentmonkey 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.

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.

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

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