PHDownloader

Pornhub 视频一键下载 | pornhub.com

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
  1. // ==UserScript==
  2. // @name PHDownloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.0.2
  5. // @description Pornhub 视频一键下载 | pornhub.com
  6. // @author Hmhm
  7. // @match *://*.pornhub.com/view_video.php?viewkey=*
  8. // @match *://*.pornhubpremium.com/view_video.php?viewkey=*
  9. // @icon https://ci.phncdn.com/www-static/favicon.ico
  10. // @grant unsafeWindow
  11. // @require https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
  12. // @license MIT
  13. // ==/UserScript==
  14.  
  15. (async function () {
  16. 'use strict';
  17. const videoWrap = document.querySelector(".video-wrapper")
  18. const signDom = document.querySelector(".video-wrapper .title-container")
  19. let remoteAddress
  20. for (let key in unsafeWindow) {
  21. if (key.startsWith('flashvars_')) {
  22. console.log(unsafeWindow[key])
  23. let flashvars = unsafeWindow[key]
  24. let mediaDefinitions = flashvars.mediaDefinitions
  25. mediaDefinitions.some(item => {
  26. if (item.remote) {
  27. remoteAddress = item.videoUrl
  28. }
  29. })
  30. }
  31. }
  32. const list = await $.ajax(remoteAddress).then(data => {
  33. return data
  34. })
  35. const dom = document.createElement("div");
  36. let str = '<div>download list</div><ul class="download_list">';
  37. list.forEach(item => {
  38. const { videoUrl, quality } = item
  39. console.log(item)
  40. str += `<li><a href="${videoUrl}" target="_blank">${quality}P</a></li>`
  41. })
  42. str += '</ul>';
  43. dom.innerHTML = str
  44. const fragment = document.createDocumentFragment();
  45. fragment.appendChild(dom)
  46. videoWrap.insertBefore(fragment, signDom)
  47. })();
  48.