黄家会所

黄家会所TV-VIP视频解锁

  1.  
  2. // ==UserScript==
  3. // @name 黄家会所
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.7.5
  6. // @description 黄家会所TV-VIP视频解锁
  7. // @author papa
  8. // @match https://www.hjhs101.com/videos/*
  9. // @match http://www.hjhs101.com/*
  10. // @match https://www.hjhs101.com/*
  11. // @match http://www.hjhs101.com/
  12. // @match https://www.hjhs101.com/
  13. // @match https://www.hjhs103.com/videos/*
  14. // @match http://www.hjhs103.com/*
  15. // @match https://www.hjhs103.com/*
  16. // @match http://www.hjhs103.com/
  17. // @match https://www.hjhs103.com/
  18. // @match https://www.hjhs104.com/videos/*
  19. // @match http://www.hjhs104.com/*
  20. // @match https://www.hjhs104.com/*
  21. // @match http://www.hjhs104.com/
  22. // @match https://www.hjhs104.com/
  23. // @match https://www.hjhs102.com/
  24. // @match https://www.hjhs102.com/videos/*
  25. // @match http://www.hjhs102.com/videos/*
  26. // @match https://www.hjhs105.com/
  27. // @match https://www.hjhs105.com/videos/*
  28. // @match http://www.hjhs105.com/videos/*
  29. // @match https://www.hjhs106.com/
  30. // @match https://www.hjhs106.com/videos/*
  31. // @match http://www.hjhs106.com/videos/*
  32. // @match https://www.hjhs107.com/
  33. // @match https://www.hjhs107.com/videos/*
  34. // @match http://www.hjhs107.com/videos/*
  35. // @match https://www.hjhs108.com/
  36. // @match https://www.hjhs108.com/videos/*
  37. // @match http://www.hjhs108.com/videos/*
  38. // @match https://www.hjhs109.com/
  39. // @match https://www.hjhs109.com/videos/*
  40. // @match http://www.hjhs109.com/videos/*
  41. // @match https://www.hjhs101.xyz
  42. // @match https://www.hjhs101.xyz/videos/*
  43. // @require http://cdn.bootcss.com/jquery/3.1.0/jquery.min.js
  44. // @require https://unpkg.com/ajax-hook/dist/ajaxhook.min.js
  45. // @run-at document-start
  46. // @grant none
  47. // @license MIT
  48. // ==/UserScript==
  49. "use strict";
  50. //感谢大佬wendux的AJAX-Hook脚本库,地址:https://github.com/wendux/Ajax-hook
  51. console.warn("黄家会所TV-VIP视频解锁:感谢大佬wendux的AJAX-Hook脚本库,地址:https://github.com/wendux/Ajax-hook");
  52. console.warn("黄家会所TV-VIP视频解锁:感谢大佬luckly-mjw的M3U8下载解析站,地址:http://blog.luckly-mjw.cn/");
  53. console.warn("黄家会所TV-VIP视频解锁:感谢m3u8player第三方解析站,地址:http://www.m3u8player.top/");
  54. var Status=0;//解析成功标志位
  55. var LoadFlag;
  56. var Test;
  57. var DownloadM3u8Url;
  58. var Issues;
  59. var Ios_Flag;
  60. function HookInfo()
  61. {
  62. ah.hook(
  63. {
  64. onreadystatechange:function(xhr,event)
  65. {
  66. console.log("黄家会所TV-VIP视频解锁:onreadystatechange事件发生:网站正在请求URL:"+xhr.responseURL);
  67. },
  68. onload:function(xhr)
  69. {
  70. console.log("黄家会所TV-VIP视频解锁:onload事件发生:网站正在请求URL:"+xhr.responseURL);
  71. },
  72. open:function(args)//修改m3u8
  73. {
  74. if(args[1].indexOf("suo")!=-1)
  75. {
  76. args[1] = args[1].replace("_suo","").replace(".b","").replace(".a","");//修复
  77. Status=1;//解析成功
  78. DownloadM3u8Url = args[1];
  79. console.warn("黄家会所TV-VIP视频解锁:解析成功");
  80. }
  81. if(Status!=1)//如果没有更新成功则刷新页面,直到更新完成
  82. {
  83. console.error("黄家会所TV-VIP视频解锁:没有拦截成功,正在重试...");
  84. location.reload();
  85. }
  86. }
  87. }
  88. )
  89. };
  90. function ChangeIssues(){
  91. if(Status==1)//解析成功
  92. {
  93. Issues =document.evaluate('/html/body/div[3]/div[2]/div[3]/div[2]/div[3]/div/div[1]/div[3]/ul/li[2]/a',document).iterateNext();
  94. var Video_Detail_Dur = document.evaluate('/html/body/div[3]/div[2]/div[3]/div[2]/div[3]/div/div[2]/div/div[2]/div[1]/span[1]',document).iterateNext();
  95. var Line_1 = $("#quality_opt_4");
  96. var Line_2 = $("#quality_opt_2");
  97. var ScrollElement = $(".sponsor")[0];
  98. var OpenUrl = `http://blog.luckly-mjw.cn/tool-show/m3u8-downloader/index.html?source=${DownloadM3u8Url}`
  99. Line_1.remove();//移除
  100. Line_2.remove();//移除
  101. Video_Detail_Dur.setAttribute("style","font-size:22px;color:red");//修改
  102. Video_Detail_Dur.children[0].setAttribute("style","font-size:22px;color:red");//修改
  103. Issues.setAttribute("style","font-size:18px;color:red");//修改
  104. Issues.text = "黄家会所TV-VIP视频解锁:VIP解析成功,请直接观看";
  105. ScrollElement.onclick=function(){window.open(OpenUrl)};
  106. ScrollElement.firstElementChild.setAttribute("style","color:green;font-size:1.01em;text-decoration;underline;cursor:pointer;user-select:text");
  107. ScrollElement.firstElementChild.textContent = "点击下载视频【非本页面直接下载】"+DownloadM3u8Url;
  108. var VideoDoc = $(".fp-ui")["context"];//获取整块播放器
  109. var VideoProcessbar = $("video")[0];//获取视频对象
  110. VideoDoc.onkeyup = function(event)
  111. {
  112. console.log("黄家会所TV-VIP视频解锁::当前输入的键代码为:"+event.keyCode);
  113. if(event.keyCode==39)
  114. {
  115. VideoProcessbar.currentTime+=10;//增加的秒数
  116. }
  117. if(event.keyCode==37)
  118. {
  119. VideoProcessbar.currentTime-=10;//减少的秒数
  120. }
  121. /*在上方代码中修改注释地方可以控制增加减少的秒数,不是特别大就好。*/
  122. if(event.keyCode==38)
  123. {
  124. try
  125. {
  126. document.body.parentNode.style.overflow = "hidden";
  127. VideoProcessbar.volume+=0.1;//增大音量
  128. }
  129. catch
  130. {
  131. VideoProcessbar.volume=1;
  132. }
  133. }
  134. if(event.keyCode==40)
  135. {
  136. try
  137. {
  138. document.body.parentNode.style.overflow = "hidden";
  139. VideoProcessbar.volume-=0.1;//减小音量
  140. }
  141. catch
  142. {
  143. VideoProcessbar.volume=0;
  144. }
  145. }
  146. }
  147. }
  148. }
  149. function HeightLightDur()
  150. {
  151. var DurClass = $(".duration");
  152. if(DurClass!=null)
  153. {
  154. var DurClass_Len = DurClass.length;
  155. for(var index=0;index<DurClass_Len;index++)
  156. {
  157. DurClass[index].textContent = "完整版时长:"+DurClass[index].textContent;
  158. DurClass[index].setAttribute("style","font-size:18px;color:red");//修改
  159. }
  160. clearInterval(LoadFlag);//加载完毕清除定时器
  161. }
  162. }
  163. function RemoveAd()
  164. {
  165. try
  166. {
  167. var BackGround_M = $("#layui-layer-shade1");//去除蒙版
  168. var Dialog_M = $("#layui-layer1");//去除弹框
  169. var Adversion_Head = $(".wrap-head-spots");//去除广告
  170. if(BackGround_M!=null&&Dialog_M!=null)
  171. {
  172. BackGround_M[0].setAttribute("class","layui-layer-move");//移除蒙版
  173. Dialog_M[0].setAttribute("class","layui-layer-move");//移除弹窗
  174. }
  175. if(Adversion_Head!=undefined)
  176. {
  177. Adversion_Head[0].remove();//移除上方广告
  178. }
  179. }
  180. catch
  181. {
  182. console.warn("黄家会所TV-VIP视频解锁:没有找到广告");
  183. clearInterval(Test);//寻找广告结束
  184. }
  185. }
  186. function IosHelper()
  187. {
  188. var RegVideoPath = /(?<=videos_screenshots\/)\d.+(?=\/p)/g;
  189. var VideoPreivewStyle;
  190. var PlayerElement = document.getElementById("player_container");
  191. if(PlayerElement!=undefined)
  192. {
  193. VideoPreivewStyle = PlayerElement.getAttribute("style");
  194. var RegeStrPath = RegVideoPath.exec(VideoPreivewStyle )[0];
  195. var CdnUrl = "https://cdn.hjhs.m3u8.xiaoxiaodl.com/m3u8/";
  196. var Cdn_End = "/index.m3u8";
  197. var Online_M3u8_url = "http://www.m3u8player.top/?play=";
  198. var IoSTips = document.evaluate('/html/body/div[3]/div[2]/div[3]/div[2]/div[3]/div/div[1]/div[3]/ul/li[2]/a',document).iterateNext();
  199. var PlayUrl = Online_M3u8_url+CdnUrl+RegeStrPath+Cdn_End;
  200. IoSTips.setAttribute("href",PlayUrl);
  201. IoSTips.setAttribute("style","font-size:15px;color:green");
  202. IoSTips.text = "IOS用户请点击这里跳转到第三方播放";
  203. clearInterval(Ios_Flag);
  204. }
  205. }
  206. if(location.href.indexOf("videos")!=-1 && location.href.indexOf("#videos")==-1)//处理分类视频的video关键字
  207. {
  208. if(navigator.appVersion.indexOf("iPhone")==-1)
  209. {
  210. HookInfo();//拦截修改m3u8文件
  211. setInterval(ChangeIssues,500);
  212. }
  213. else
  214. {
  215. Ios_Flag = setInterval(IosHelper,1000);
  216. }
  217. }
  218. else
  219. {
  220. ShowDisabledInfo();//提示过期
  221. LoadFlag = setInterval(HeightLightDur,1000);//设置定时器
  222. Test = setInterval(RemoveAd,1000);//开始去广告
  223. }
  224.