PH_Downloader

pornhub.com

Verze ze dne 24. 01. 2025. Zobrazit nejnovější verzi.

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

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

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         PH_Downloader
// @namespace    ph
// @version      0.0.3
// @description  pornhub.com
// @author       Hmhm
// @match        *://*.pornhub.com/view_video.php?viewkey=*
// @match        *://*.pornhubpremium.com/view_video.php?viewkey=*
// @grant        unsafeWindow
// @license      WTFPL
// ==/UserScript==

(Win=>{
	for(let key in Win){
		if(key.startsWith("flashvars_")){
			let flashvars = unsafeWindow[key];
			for(let md of flashvars?.mediaDefinitions){
				if(md?.format=="mp4"){
					fetch(md.videoUrl,{mode:"cors"}).then(r=>r.json()).then(json=>{
						let str = json.map(obj=>`<h1><a href="${obj?.videoUrl}">${obj?.quality}P</a></h1>`).join("");
						let dom = document.createElement("div");
						dom.innerHTML = str;
						document.querySelector(".video-wrapper")
							.insertBefore(dom,document.querySelector(".video-wrapper .title-container"));

					});
					break;
				}
			}
		}
	}
})(unsafeWindow??window);