xvideo downloader

try to take over the world!

  1. // ==UserScript==
  2. // @name xvideo downloader
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.22
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.xvideos.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. window.addEventListener('load', function(){
  12. var cum
  13. var s_html = `
  14. <div class="ct_div">
  15.  
  16. <style>
  17. /*最外層的框*/
  18. .ct_div {
  19. background-color: #FFF;
  20. padding: 5px;
  21. padding-left: 11px;
  22. }
  23.  
  24. /*「截圖」按鈕*/
  25. .but_ct {
  26. margin-top: 10px;
  27. padding: 3px 7px;
  28. border: 2px solid #00B4D8;
  29. color: #00B4D8;
  30. display: inline-block;
  31. text-align: center;
  32. line-height: 27px;
  33. font-size: 1.4em;
  34. margin-right: 10px;
  35. }
  36.  
  37. .but_ct:hover {
  38. background-color: #00B4D8;
  39. border: 1px solid #00B4D8;
  40. color: #FFF;
  41. display: inline-block;
  42.  
  43.  
  44. </style>
  45. <div class="but_ct" >下載影片!</div>
  46.  
  47.  
  48. </div>
  49. `
  50.  
  51. function gongneng(p,M) {
  52. var x,r,g,k,s,vid,Z;
  53. x = document.getElementsByTagName("div");
  54. r = x[14].textContent;
  55. r.match(/.mp4/).input;
  56. g = r.match(/.mp4/).input;
  57. k = g.split("{");
  58. try{
  59. s = k[42].match(/mp4/).input;
  60. }
  61. catch(e) {
  62. s = k[41].match(/mp4/).input;
  63. }
  64. vid = s.split(/VideoUrlHigh/)[1].split(/html5/)[0];
  65. Z = vid.replace("');", "");
  66. M = Z.replace("('", "");
  67. cum=M
  68.  
  69. }
  70.  
  71.  
  72. function addbtn(p,M){
  73. let pretag = document.getElementsByTagName("div");
  74. p = pretag[14];
  75. let btn = document.createElement("div");
  76. btn.innerHTML = s_html;
  77. btn.onclick = ()=>{
  78. window.open(cum);
  79. }
  80.  
  81. p.insertBefore(btn, p.childNodes[0]);
  82.  
  83. }
  84.  
  85. gongneng();
  86.  
  87. addbtn();
  88.  
  89.  
  90. });