pornhub video frame changer

pornhub video frame changer !!

  1. // ==UserScript==
  2. // @name pornhub video frame changer
  3. // @namespace http://ncii.kr/
  4. // @copyright 2018, ncii.kr
  5. // @version 1.0.100
  6. // @description pornhub video frame changer !!
  7. // @icon https://www.google.com/s2/favicons?domain=www.pornhub.com
  8. // @author You
  9. // @match *://www.pornhub.com/view_video*
  10. // @run-at document-end
  11. // @grant GM_xmlhttpRequest
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. var player_container = document.getElementsByClassName('playerFlvContainer')[0];
  17. var info_container = document.getElementsByClassName('video-actions-menu')[0];
  18. var info_container2 = document.getElementsByClassName('video-actions-container')[0];
  19. info_container.remove();
  20. info_container2.remove();
  21. player_container.remove();
  22. var el = document.getElementById('player');
  23. var idx = el.getAttribute('data-video-id');
  24. var quality = eval("qualityItems_" + idx);
  25.  
  26.  
  27. var qu_txt;
  28. var down_link;
  29. var convert_qua;
  30. var max_qua = [];
  31. var save_link = [];
  32. for (var i = 0; i < quality.length; i++){
  33. qu_txt = quality[i].text;
  34. down_link = quality[i].url;
  35. convert_qua = qu_txt.replace(/[^0-9]/g,'');
  36. if (convert_qua < 1080){
  37. max_qua.push(convert_qua);
  38. save_link.push(down_link);
  39. };
  40. };
  41. var max_ = (Math.max.apply(Math,max_qua));
  42. for (var l = 0; l < save_link.length; l++){
  43. var now_ = save_link[l];
  44. var match_link = now_.indexOf(max_);
  45. if ( match_link != -1 ){
  46. var inject_video = document.createElement('video');
  47. inject_video.setAttribute('controls','');
  48. inject_video.setAttribute('name','media');
  49. inject_video.setAttribute('class','html5-download-video');
  50. var createSource = document.createElement('source');
  51. createSource.setAttribute('src',now_);
  52. createSource.setAttribute('type','video/mp4');
  53. document.getElementById('player').appendChild(inject_video);
  54. document.getElementsByClassName('html5-download-video')[0].appendChild(createSource);
  55. break;
  56. };
  57. };
  58.  
  59.  
  60. })();