Sleazy Fork is available in English.

去除广告+瀑布流

去除广告+瀑布流+自动播放

  1. // ==UserScript==
  2. // @name 去除广告+瀑布流
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description 去除广告+瀑布流+自动播放
  6. // @author You
  7. // @match *://www.91porn.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=91porn.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14. const scriptDom1 = document.createElement('script');
  15. const scriptDom2 = document.createElement('script');
  16. scriptDom1.setAttribute('src', 'https://fastly.jsdelivr.net/npm/hls.js@latest');
  17. scriptDom2.setAttribute(
  18. 'src',
  19. 'https://fastly.jsdelivr.net/npm/dplayer@1.26.0/dist/DPlayer.min.js'
  20. );
  21. document.body.appendChild(scriptDom1);
  22. document.body.appendChild(scriptDom2);
  23. window.onload = function () {
  24. if (window.location.pathname === '/view_video.php') {
  25. function getMediaSource() {
  26. function strencode2(f) {
  27. var a = {
  28. Anfny: function b(c, d) {
  29. return c(d);
  30. },
  31. };
  32. return a['Anfny'](unescape, f);
  33. }
  34. var jm = strencode2(
  35. document.documentElement.outerHTML
  36. .split('document.write(strencode2("')[1]
  37. .split('"')[0]
  38. );
  39. return jm.split("<source src='")[1].split("'")[0];
  40. }
  41.  
  42. const videoArea = document.querySelector('.video-container');
  43. const { height, width } = videoArea.getBoundingClientRect();
  44. const poster = videoArea.children[0].getAttribute('poster');
  45. const playerSource = getMediaSource().replace(/https:\/\/.*?\.com/,'https://cdn77.91p49.com');
  46. const playerDom = document.createElement('div');
  47.  
  48. playerDom.style = `height: ${height}px;width: ${width}px;`;
  49. playerDom.id = 'dplayer';
  50. videoArea.children[0].remove();
  51. videoArea.appendChild(playerDom);
  52. const dp = new DPlayer({
  53. container: document.getElementById('dplayer'),
  54. autoplay: true,
  55. video: {
  56. defaultQuality: 0,
  57. quality: [
  58. {
  59. url: playerSource,
  60. type: 'hls',
  61. },
  62. ],
  63. pic: poster,
  64. },
  65. });
  66. dp.seek(5);
  67. } else {
  68. const doms = Array.from(
  69. document.querySelectorAll('.col-xs-12.col-sm-4.col-md-3.col-lg-3')
  70. ).forEach((dom, index) => {
  71. if (index === 0) {
  72. dom.parentNode.setAttribute('class', 'flex-container');
  73. }
  74. dom.setAttribute('class', 'flex-item');
  75. });
  76. const style = document.createElement('style');
  77. style.innerHTML = `
  78. .flex-container{
  79. column-count:4;
  80. }
  81. .flex-item{
  82. break-inside: avoid;
  83. overflow: hidden;
  84. }
  85. .title-truncate,.video-title title-truncate m-t-5{
  86. white-space: normal;
  87. }
  88. `;
  89. document.head.appendChild(style);
  90. }
  91. };
  92. })();