thisVID.com Native Player (HTML5) and download

Replace video player with HTML5 native player (also enables download of videos)

2025-02-08 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         thisVID.com Native Player (HTML5) and download
// @namespace    _pc
// @version      2
// @license      MIT
// @description  Replace video player with HTML5 native player (also enables download of videos)
// @author       verydelight
// @match        *://thisvid.com/videos/*
// @grant        none
// ==/UserScript==

(function() {
	'use strict';
	function insertVideo() {
		const videoElement = document.querySelector('video.fp-engine');
		if (!videoElement) return;
		const videoUrl = videoElement.src;
		const fpPlayer = document.querySelector('.fp-player');
		const ktPlayer = document.getElementById('kt_player');
		const imgElement = document.querySelector('.video-holder img');
		[fpPlayer, ktPlayer, imgElement].forEach(el => el?.remove());
		const newVideoElement = document.createElement('video');
		newVideoElement.src = videoUrl;
		newVideoElement.controls = true;
		newVideoElement.setAttribute("style", "width:100%;");
		const videoHolder = document.querySelector('.video-holder');
		if (videoHolder) {
			videoHolder.appendChild(newVideoElement);
			newVideoElement.play();
		}
		observer.disconnect();
	}
	const observer = new MutationObserver(mutations => {
		mutations.forEach(mutation => {
			if (mutation.addedNodes.length) {
				insertVideo();
			}
		});
	});
	const targetNode = document.body;
	const config = { childList: true, subtree: true };
	observer.observe(targetNode, config);
})();