PH_Downloader

pornhub.com

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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         PH_Downloader
// @namespace    ph
// @version      0.0.4
// @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_")){
			for(let md of Win[key]?.mediaDefinitions){
				if(md?.format=="mp4"){
					fetch(md.videoUrl,{mode:"cors"}).then(r=>r.json()).then(json=>{
						let dom = document.createElement("div");
						dom.innerHTML = json.map(obj=>`<h1><a href="${obj?.videoUrl}">${obj?.quality}p</a></h1>`).join("");
						if(typeof(isPlatformMobile)!="undefined"&&isPlatformMobile==1)
							document.body.insertBefore(dom,document.querySelector("#mobileContainer"));
						else
							document.querySelector("#main-container").insertBefore(dom,document.querySelector("#vpContentContainer"));
					});break;
				}
			}
		}
	}
})(unsafeWindow??window);