Sleazy Fork is available in English.

xhamster download video

Download videos from xhamster.com

  1. // ==UserScript==
  2. // @name xhamster download video
  3. // @namespace http://57utjhgkkyuj.com
  4. // @include https://xhamster.com/videos/*
  5. // @include https://*.xhamster.com/videos/*
  6. // @version 2.0
  7. // @grant none
  8. // @description Download videos from xhamster.com
  9. // ==/UserScript==
  10.  
  11.  
  12. var s = document.getElementsByTagName('script');
  13.  
  14. for (var a=0; a<s.length; a++) {
  15. if (s[a].innerHTML.indexOf('window.initials')!=-1) {
  16. var ih = s[a].innerHTML.toString();
  17. var link = ih.split('"mp4File"')[1].split('"')[1].split('"')[0];
  18. var nlink = ih.split('"sources"')[1].split('"download"')[1];
  19. var nnlink, nnlink1, nnlink2 = null;
  20. try {
  21. nnlink1 = nlink.split('"480p"')[1].split('"link"')[1].split('"')[1];
  22. nnlink1 = unescape(nnlink1);
  23. } catch(e) {}
  24. try {
  25. nnlink2 = nlink.split('"240p"')[1].split('"link"')[1].split('"')[1];
  26. nnlink2 = unescape(nnlink2);
  27. }
  28. catch(e) {}
  29. link = unescape(link);
  30. break;
  31. }
  32. }
  33.  
  34. link = link.replace(/\\/g, "");
  35.  
  36.  
  37.  
  38. if (nnlink1 != null) {
  39. nnlink1 = nnlink1.replace(/\\/g, "");
  40. var c1 = document.createElement("div");
  41. c1.id="480download";
  42. c1.style='display: block; z-index:10001 !important; font-size:108%; line-height:108%; color: #ffffff; background-color: #222222; border: 2px solid #7f7ebe; margin-left: auto; margin-right:auto; text-align:center; font-weight:bold;'
  43. c1.innerHTML = "<a href='"+nnlink1+"' style='color: #ffffff; background-color: #222222; margin-right:auto; margin-left:auto; align:center;'>Download 480p Video</a>"
  44. if (!document.getElementById("480download")) {
  45. document.body.insertBefore(c1, document.body.firstChild);
  46. }
  47. }
  48.  
  49. if (nnlink2 != null) {
  50. nnlink2 = nnlink2.replace(/\\/g, "");
  51. var c2 = document.createElement("div");
  52. c2.id="240download";
  53. c2.style='display: block; z-index:10001 !important; font-size:108%; line-height:108%; color: #ffffff; background-color: #222222; border: 2px solid #7f7ebe; margin-left: auto; margin-right:auto; text-align:center; font-weight:bold;'
  54. c2.innerHTML = "<a href='"+nnlink2+"' style='color: #ffffff; background-color: #222222; margin-right:auto; margin-left:auto; align:center;'>Download 240p Video</a>"
  55. if (!document.getElementById("240download")) {
  56. document.body.insertBefore(c2, document.body.firstChild);
  57. }
  58. }
  59.  
  60. var c = document.createElement("div");
  61. c.id="defaultdownload";
  62. c.style='display: block; z-index:10001 !important; font-size:108%; line-height:108%; color: #ffffff; background-color: #222222; border: 2px solid #7f7ebe; margin-left: auto; margin-right:auto; text-align:center; font-weight:bold;'
  63. c.innerHTML = "<a href='"+link+"' style='color: #ffffff; background-color: #222222; margin-right:auto; margin-left:auto; align:center;'>Download Video</a>"
  64. if (!document.getElementById("defaultdownload")) {
  65. document.body.insertBefore(c, document.body.firstChild);
  66. }