PHDownloader

Pornhub 视频一键下载 | pornhub.com

Version vom 29.12.2023. Aktuellste Version

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 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         PHDownloader
// @namespace    http://tampermonkey.net/
// @version      0.0.1
// @description  Pornhub 视频一键下载 | pornhub.com
// @author       Hmhm
// @match        *://*.pornhub.com/view_video.php?viewkey=*
// @icon         https://ci.phncdn.com/www-static/favicon.ico
// @grant        unsafeWindow
// @require      https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @license MIT
// ==/UserScript==

(async function () {
  'use strict';
  const videoWrap = document.querySelector(".video-wrapper")
  const signDom = document.querySelector(".video-wrapper .title-container")
  let remoteAddress
  for (let key in unsafeWindow) {
    if (key.startsWith('flashvars_')) {
      console.log(unsafeWindow[key])
      let flashvars = unsafeWindow[key]
      let mediaDefinitions = flashvars.mediaDefinitions
      mediaDefinitions.some(item => {
        if (item.remote) {
          remoteAddress = item.videoUrl  
        }
      })
    }
  }
  const list = await $.ajax(remoteAddress).then(data => {
    return data
  })
  const dom = document.createElement("div");
  let str = '<div>download list</div><ul class="download_list">';
  list.forEach(item => {
    const { videoUrl, quality } = item
    console.log(item)
    str += `<li><a href="${videoUrl}" target="_blank">${quality}P</a></li>`
  })
  str += '</ul>';
  dom.innerHTML = str
  const fragment = document.createDocumentFragment();
  fragment.appendChild(dom)
  videoWrap.insertBefore(fragment, signDom)
})();