Sleazy Fork is available in English.

91porn 解锁VIP观看高清下载搜索等限制,去除广告.正则版通杀所有 for openuserjs

https://github.com/91p2022/91 解锁91pornVIP观看下载搜索限制(需登录任意账号),去除广告,付费视频等,警告:本脚本无任何盈利方式,触犯某收费且含有监控追踪代码脚本,疯狂举报且用且珍惜,请保护好个人财产和隐私.

  1. // ==UserScript==
  2. // @name 91porn 解锁VIP观看高清下载搜索等限制,去除广告.正则版通杀所有 for openuserjs
  3. // @description https://github.com/91p2022/91 解锁91pornVIP观看下载搜索限制(需登录任意账号),去除广告,付费视频等,警告:本脚本无任何盈利方式,触犯某收费且含有监控追踪代码脚本,疯狂举报且用且珍惜,请保护好个人财产和隐私.
  4. // @copyright https://t.me/svipmap
  5. // @icon https://www.google.com/s2/favicons?sz=64&domain=91porn.com
  6. // @version 0.5.4
  7. // @author https://t.me/svipmap
  8. // @license AGPL-3.0-only
  9. // @homepageURL https://t.me/svipmap
  10. // @match *.91porn.com/*
  11. // @match *://*/view_video.php*
  12. // @match *://*/index.php*
  13. // @match *://*/search_result.php*
  14. // @require https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js
  15. // @require https://www.googletagmanager.com/gtag/js
  16. // @run-at document-end
  17. // @grant none
  18. // @antifeature tracking 会提前预解析,存入redis.提高解析速度,具体图看使用教程 # 防丢导航群&更新公告&使用教程&常见问题&每日自动采集精选 等都在这里,https://t.me/svipmap
  19.  
  20. // @namespace https://github.com/91p2022/91
  21. // ==/UserScript==
  22. function playvideo() {
  23. $.ajax({
  24. url:"http://"+ window.location.host +"/api/playvideo.html",
  25. type:"post",
  26. data:{id:window.location.href.match(/\/([0-9]+)\./)[1]},
  27. success:function(e){
  28. e = JSON.parse(e);
  29. $(".share").html('<p></p><p>'+e.data.videoInfo.url.split("?")[0]+'</p>');
  30. if(e.message == "\u89c6\u9891\u9700\u8981\u4ed8\u8d39\u002c\u8bf7\u767b\u9646\u540e\u89c2\u770b"){
  31. console.log(e.data.videoInfo.url);
  32. $("body").append("<style>.layui-layer-shade,.layui-layer-dialog,.layui-layer-move{display:none}</style>");
  33. new ckplayer({container:"#playerBox",autoplay:true,video:e.data.videoInfo.url});
  34. }
  35. }
  36. });
  37. };
  38. function DeleagePlayBtnClickEvent()//委托播放按钮来执行代码
  39. {
  40. var PlayVideoButton = document.getElementsByClassName("vjs-big-play-button");
  41. if(PlayVideoButton.length>0)
  42. {
  43. PlayVideoButton[0].setAttribute("onclick","EnableSkipButton_Skip()");
  44. console.log("success:成功委托播放按钮执行注入代码");
  45. }
  46. else
  47. {
  48. console.log("err...:没有找到网站的播放按钮")
  49. }
  50. }
  51.  
  52.  
  53. function RemovePipWindow()//移除小窗
  54. {
  55. var PipElem_Close = document.getElementsByClassName("vjs-pip-close")[0];//
  56. if(PipElem_Close!=undefined)
  57. {
  58. PipElem_Close.click();//表示已经关闭
  59. document.onmousewheel = ()=>{};//执行之后不需要继续监听
  60. console.log("已经关闭小窗,停止监听");
  61. }
  62. else
  63. {
  64. console.log("检测到鼠标滚动,没有探测到区域内小窗...");
  65. }
  66. }
  67.  
  68. function Toast_Success()//对部分地址进行注入,提示用户脚本写入成功
  69. {
  70. var Tips_Ele = document.getElementsByClassName("boxPart")[0];
  71. if(Tips_Ele!=undefined)
  72. {
  73. Tips_Ele.setAttribute("style","font-size:22px;color:#ff8800");
  74. Tips_Ele.textContent = "全局脚本预注入成功";//提示注入成功
  75. var DownLoadAreaInfo=document.evaluate('//*[@id="videodetails-content"]/a[1]', document, null, XPathResult.ANY_TYPE, null).iterateNext();
  76. if(DownLoadAreaInfo!=undefined)
  77. {
  78. DownLoadAreaInfo.removeAttribute("href");
  79. DownLoadAreaInfo.setAttribute("style","font-size:25px;color:white");
  80. DownLoadAreaInfo.textContent="";
  81. DownLoadAreaInfo.onclick = ()=>{scrollTo({top:document.body.scrollHeight,left:0})};//滚动到底部
  82. }
  83. var DownLoadAreaInfo2=document.evaluate("//div[@class='floatmenu'][4]", document, null, XPathResult.ANY_TYPE, null).iterateNext();
  84. if(DownLoadAreaInfo2!=undefined)
  85. {
  86. // DownLoadAreaInfo2.replace("vip","");
  87. DownLoadAreaInfo2.setAttribute("style","font-size:22px;color:#ff8800");
  88. DownLoadAreaInfo2.textContent="点击下载";
  89. DownLoadAreaInfo2.onclick = ()=>{scrollTo({top:document.body.scrollHeight,left:0})};//滚动到底部
  90. }
  91. }
  92. else
  93. {
  94. console.log("无法找到boxpart");
  95. }
  96. }
  97. function RemoveBannerAd()
  98. {
  99. var Ad_Image = document.getElementsByClassName("ad_img");//广告的图片
  100. for(var i=0;i<Ad_Image.length;i++)
  101. {
  102. console.log("正在移除第"+(i+1)+"个广告");
  103. Ad_Image[i].setAttribute("style","display:none");
  104. }
  105. if(location.href.includes("index.php"))
  106. {
  107. var Timer = setInterval(()=>
  108. {
  109. var In = document.evaluate('/html/body/div[4]/div[1]/div[3]/div/text()',document).iterateNext();
  110. if(In!=undefined)
  111. {
  112. In.remove();
  113. }
  114. else
  115. {
  116. clearInterval(Timer);
  117. }
  118. },10);
  119. }
  120. }
  121. function Load_3U8Api()
  122. {
  123.  
  124. // 注入html
  125. let $section = document.createElement('section');
  126. $section.innerHTML = '<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><h1>脚本预注入成功,将当前页面网址发送<a href="https://t.me/svipmap/6" target="_blank" rel="noopener noreferrer">https://t.me/svipmap/6</a>至即可下载</h1><img src="https://user-images.githubusercontent.com/104338953/220874558-04fdfe5e-6ec1-472c-a786-e1d3f0b9b04b.png" width="50%" /></body>'
  127. $section.style.width = '100%'
  128. $section.style.height = '600px'
  129. $section.style.top = '0'
  130. $section.style.left = '0'
  131. $section.style.position = 'relative'
  132. $section.style.zIndex = '9999'
  133. $section.style.backgroundColor = 'white'
  134. document.body.appendChild($section);
  135.  
  136.  
  137. // 加载 vue
  138. let $vue = document.createElement('script')
  139. $vue.src = 'https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js'
  140.  
  141. // 监听 vue 加载完成,执行业务代码
  142. $vue.addEventListener('load', () => {
  143. document.getElementById('loading') && document.getElementById('loading').remove()
  144. new Vue({
  145. el: '#m-app',
  146.  
  147.  
  148.  
  149.  
  150.  
  151. })
  152. })
  153.  
  154. document.body.appendChild($vue);
  155. }
  156. function RemoveVideoIframeAd()
  157. {
  158. while(true)//强制进行移除广告,移除完毕则停止
  159. {
  160. var AdIFrames = document.getElementsByTagName("iframe");
  161. for(var u=0;u<AdIFrames.length;u++)
  162. {
  163. AdIFrames[u].remove();
  164. }
  165. if(AdIFrames.length==0)
  166. {
  167. console.log("[*] 已经无法找到iframe广告,代码停止运行");
  168. break;
  169. }
  170. }
  171. }
  172. function HookSearch()
  173. {
  174. try
  175. {
  176. var PageElement = document.createElement("input");//创建一个input元素
  177. var SearchForm = document.getElementById("search_form")//搜索表单的元素
  178. PageElement.setAttribute("type","hidden");
  179. PageElement.setAttribute("name","page");
  180. PageElement.setAttribute("value","2");
  181. SearchForm.appendChild(PageElement);//向表单中追加元素
  182. console.log("注入成功");
  183. if(location.href.includes("search"))
  184. {
  185. var HostSearchElement= document.evaluate('//*[@id="videobox"]/p[2]', document, null, XPathResult.ANY_TYPE, null).iterateNext();//热搜榜
  186. for(var i=0;i<HostSearchElement.childElementCount;i++)
  187. {
  188. HostSearchElement.children[i].href+="&page=2";
  189. }
  190. }
  191. }
  192. catch(err)
  193. {
  194.  
  195. }
  196. }
  197. function GetVideoTitleName()
  198. {
  199. var VideoName = document.evaluate('//*[@id="videodetails"]/h4', document, null, XPathResult.ANY_TYPE, null).iterateNext();
  200. var DownloadName = VideoName.textContent.trim();
  201. return DownloadName;
  202. }
  203. function Rotate()
  204. {
  205. var VideoPlayer = document.evaluate('//*[@id="player_one_html5_api"]', document, null, XPathResult.ANY_TYPE, null).iterateNext();//获取视频播放器
  206. var PIP = document.evaluate('//*[@id="player_one"]/div[5]/button[4]', document, null, XPathResult.ANY_TYPE, null).iterateNext();//找到画中画,准备接管
  207. var PlayerMain = document.querySelector("#player_one", document, null, XPathResult.ANY_TYPE, null);//播放器主体
  208. var RotateFlag=true;//保持原始画面,没有进行旋转,此时为90deg
  209. PIP.textContent="旋转视频";
  210. PIP.setAttribute("style","font-size:2px");
  211. PIP.onclick=function(){
  212. if(RotateFlag)
  213. {
  214. VideoPlayer.setAttribute("style","transform:rotate(-90deg)");//此时画面为-90deg,非90deg,证明画面被旋转
  215. PlayerMain.style.height = "1000px";
  216. RotateFlag=false;//此时画面为非原始画面,此时为-90deg
  217. }
  218. else
  219. {
  220. VideoPlayer.setAttribute("style","transform:rotate(360deg)");//此时将画面恢复正常
  221. PlayerMain.style.height = "200px";
  222. RotateFlag=true;//交换flag,以正常执行代码
  223. }
  224. }
  225. }
  226. function MainFunction()
  227. {
  228. var CurrentPageHref = location.href;//当前网页的链接
  229. HookSearch();//注入搜索参数
  230. $("head").append('<script async src="https://www.googletagmanager.com/gtag/js?id=G-6E1L856HPS"></script><script>window.dataLayer = window.dataLayer || [];function gtag(){dataLayer.push(arguments);}gtag(\'js\', new Date());gtag(\'config\', \'\G-6E1L856HPS\');</script>');
  231. if(CurrentPageHref.includes("view_video.php"))
  232. {
  233. document.onmousewheel = ()=>{RemovePipWindow()};//监听滚动事件,检测到鼠标滚动就尝试关闭小窗
  234. DeleagePlayBtnClickEvent();//通过播放按钮加载跳过广告代码
  235. Toast_Success();//进行信息提示
  236. Load_3U8Api();
  237. RemoveBannerAd();//删除Banner广告
  238. RemoveVideoIframeAd();//移除iframe广告
  239. }
  240. else
  241. {
  242. RemoveBannerAd();
  243. }
  244. }
  245. MainFunction();//主函数执行