You're never really done for, as long as you‘ve got a good story and someone to tell it to.

pornhub下载视频的方法

闲着没事,写个代码获取下下载视频地址
使用方法就是,右键选择检查,选择console,然后粘贴进这段代码,视频地址就会复制到你的剪切板,如果你迅雷已经打开,那太好了,迅雷会直接提示下载

Object.keys(window).forEach((v) => {
 if (~v.indexOf("flash")) {
  function get_media(url, callback) {
   const xmlhttp = window.XMLHttpRequest
    ? new XMLHttpRequest()
    : new ActiveXObject("Microsoft.XMLHTTP");
   xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
     callback(JSON.parse(xmlhttp.responseText));
    }
   };
   xmlhttp.open("GET", url, true);
   xmlhttp.send();
  }
  const textarea = document.createElement("textarea"),
   currentFocus = document.activeElement,
   toolBoxwrap = document.getElementsByTagName("body")[0],
   flash = window[v];
  toolBoxwrap.appendChild(textarea);
  let mediaDefinitions = flash.mediaDefinitions;
  mediaDefinitions.sort((a, b) => a.quality - b.quality);
  mediaDefinitions = mediaDefinitions.filter((item) => item.videoUrl !== "");
  const mp4_list = get_media(mediaDefinitions[0].videoUrl, (mp4List) => {
    textarea.value = mp4List[mp4List.length - 1].videoUrl; 
    textarea.focus();
    if (textarea.setSelectionRange)
     textarea.setSelectionRange(0, textarea.value.length);
    else textarea.select();
    document.execCommand("copy");
    toolBoxwrap.removeChild(textarea);
    currentFocus.focus();
    console.log(`${flash.video_title}\n已复制到剪切板`);
  });
 }
});

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×