xvideos download linker

Adds download links to videos on xvideos.com

  1. // ==UserScript==
  2. // @name xvideos download linker
  3. // @namespace http://www.jfyrdtrdfvgytifgfgygu.com
  4. // @description Adds download links to videos on xvideos.com
  5. // @version 1.1.1
  6. // @include http://*.xvideos.com/*
  7. // @include http://xvideos.com/*
  8. // @include https://*.xvideos.com/*
  9. // @include https://xvideos.com/*
  10. // @grant GM_xmlhttpRequest
  11. // ==/UserScript==
  12. //
  13. //v 1.1
  14.  
  15. function newget(uu) {
  16. var ng = GM_xmlhttpRequest({
  17. method:"GET",
  18. url:uu,
  19. headers:{
  20. "User-Agent":"Mozilla/5.0 (Windows NT 6.2; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0",
  21. "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
  22. },
  23. ignoreRedirect:true,
  24. synchronous:true,
  25. });
  26. return ng.responseText.split("flashvar")[1];
  27. }
  28.  
  29. var a = document.getElementById("flash-player-embed");
  30. var s = document.getElementsByTagName("script");
  31. var b = null;
  32. for (var si = 0; si < s.length; si++) {
  33. if (s[si].textContent.indexOf("html5player.setVideoUrlHigh")!=-1) {
  34. b = s[si].textContent.split("html5player.setVideoUrlHigh")[1].split("('")[1].split("'")[0];
  35. b = unescape(b);
  36. break;
  37. }
  38. }
  39.  
  40. if (b==null) {
  41. try {
  42. var b = a.getAttribute("flashvars").toString();
  43. } catch(e) {
  44. try {
  45. var b = a.nextSibling.getAttribute("flashvars").toString();
  46. } catch(e) {
  47. b = newget(document.location.href);
  48. }
  49. }
  50.  
  51.  
  52. b = unescape(b);
  53. b = b.split("flv_url=")[1];
  54. b = unescape(b);
  55. b = b.split("|")[0];
  56. b = b.split("&url_bigthumb")[0];
  57. b = b.split("&amp;url_bigthumb")[0];
  58. }
  59.  
  60.  
  61. var c = document.createElement("div");
  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='"+b+"' style='margin-right:auto; margin-left:auto; align:center; color:white;'>Download Video</a>"
  64. document.body.insertBefore(c, document.body.firstChild);
  65.