虎牙超精简

虎牙超精简-给与自己纯粹的直播观看体验

  1. // ==UserScript==
  2. // @name 虎牙超精简
  3. // @namespace http://tampermonkey.net/
  4. // @Icon https://www.huya.com/favicon.ico
  5. // @version 1.3
  6. // @description 虎牙超精简-给与自己纯粹的直播观看体验
  7. // @author BigHum
  8. // @match https://www.huya.com/*
  9. // @grant none
  10. // @license GPL-3.0-only
  11. // @require http://code.jquery.com/jquery-3.1.1.min.js
  12. // @require https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. // Your code here...();
  19. $(function () {
  20. var html = //'<div style=" width: 100%; height: 1080px; position: fixed; background: black; opacity: 0.6; z-index: 9998;">'+
  21. // '</div>'+
  22. // '<div style="width: 107px; height: 256px; background: white; position: fixed; top: 10%; left: 50px; border-radius: 5px; z-index: 10001;"></div>'+
  23. // '<span style="position: fixed; background: white; top: 20%; left: 30%; padding: 10px; z-index: 10001;">下一步</span>'+
  24. //设置弹窗
  25.  
  26. '<div id="tanchuang" style="user-select: none; background: #dcdde1; position: absolute; top: 10%; left: 50px; z-index: 9999; border: 1px solid #84817a; border-radius: 5px;">'+
  27. '<a class="shou" href="javascript:void(0)" style=" position: absolute; top: -1px; right: -53px; display: block; width: 48px; height: 50px; line-height: 50px; background: #dcdde1; text-align: center; border: 1px solid #84817a; border-radius: 5px;">'+
  28. '<em class="iconfont">&larr;</em>'+
  29. '</a>'+
  30. '<ul>'+
  31.  
  32. '<li style=" border-bottom: 1px solid #84817a;">'+
  33. '<label style="display: inline-block;padding: 16px 5px;" for="rightdanmu"><span style="padding: 0 5px;">右侧弹幕开启</span><input id="rightdanmu" style="vertical-align: middle;" type="checkbox" name="name" value="" /></label>'+
  34. '</li>'+
  35.  
  36. '<li style=" border-bottom: 1px solid #84817a;">'+
  37. '<label style="display: inline-block;padding: 16px 5px;" for="bottomliwu"><span style="padding: 0 5px;">下方礼物开启</span><input id="bottomliwu" style="vertical-align: middle;" type="checkbox" name="name" value="" /></label>'+
  38. '</li>'+
  39.  
  40. '<li style=" border-bottom: 1px solid #84817a;">'+
  41. '<label style="display: inline-block;padding: 16px 5px;" for="centerdanmu"><span style="padding: 0 5px;">中间弹幕开启</span><input id="centerdanmu" style="vertical-align: middle;" type="checkbox" name="name" value="" /></label>'+
  42. '</li>'+
  43.  
  44. '<li style=" border-bottom: 1px solid #84817a;">'+
  45. '<label style="display: inline-block;padding: 16px 5px;" for="centertexiao"><span style="padding: 0 5px;">中间特效开启</span><input id="centertexiao" style="vertical-align: middle;" type="checkbox" name="name" value="" /></label>'+
  46. '</li>'+
  47.  
  48. '<li>'+
  49. '<label style="display: inline-block;padding: 16px 5px;" for="tophuazhi"><span style="padding: 0 5px;">最高画质开启</span><input id="tophuazhi" style="vertical-align: middle;" type="checkbox" name="name" value="" /></label>'+
  50. '</li>'+
  51.  
  52. '</ul>'+
  53. '</div>'
  54. $("body").prepend(html)
  55.  
  56. var widths = $("#tanchuang").innerWidth() + 2 ;
  57.  
  58. //设置收起开始
  59. $(".shou").click(function () {
  60. if ($(this).parent().css("left") == "50px") {
  61. $(this).parent().animate({
  62. left: "-" + widths + "px"
  63. });
  64. $(this).html('<em class="iconfont">&rarr;</em>');
  65. $.cookie('shou', 'full',{ expires : 99999});
  66. console.log($.cookie('shou'))
  67. } else {
  68. $(this).parent().animate({
  69. left: "50px"
  70. });
  71. $(this).html('<em class="iconfont">&larr;</em>');
  72. $.cookie('shou', 'empty',{ expires : 99999});
  73. console.log($.cookie('shou'))
  74. }
  75. })
  76.  
  77.  
  78. if($.cookie('shou') == null){
  79.  
  80. }else{
  81. if($.cookie('shou') == "empty"){
  82. console.log($.cookie('shou'))
  83. $("#tanchuang").animate({
  84. left: "50px"
  85. });
  86. $(".shou").html('<em class="iconfont">&larr;</em>');
  87. }else{
  88. console.log($.cookie('shou'))
  89. $("#tanchuang").animate({
  90. left: "-" + widths + "px"
  91. });
  92. $(".shou").html('<em class="iconfont">&rarr;</em>');
  93. }
  94. }
  95. //设置收起结束
  96.  
  97. //右侧弹幕栏
  98. if($.cookie("rightdanmu") !== null){
  99. if($.cookie("rightdanmu") == "true"){
  100. $("#rightdanmu").attr("checked",true)
  101. }else{
  102. $("#rightdanmu").attr("checked",false)
  103. $("#J_roomWeeklyRankListRoot").css("overflow","auto");
  104. }
  105. }
  106.  
  107.  
  108. $("#rightdanmu").click(function () {
  109. if ($(this).prop('checked')) {
  110. $.cookie("rightdanmu","true",{ expires : 99999})
  111. } else {
  112. $.cookie("rightdanmu","false",{ expires : 99999})
  113. }
  114. })
  115.  
  116. //下方礼物栏
  117. if($.cookie("bottomliwu") !== null){
  118. if($.cookie("bottomliwu") == "true"){
  119. $("#bottomliwu").attr("checked",true)
  120. }else{
  121. $("#bottomliwu").attr("checked",false)
  122. $("#J_roomWeeklyRankListRoot").css("overflow","auto");
  123. }
  124. }
  125.  
  126.  
  127. $("#bottomliwu").click(function () {
  128. if ($(this).prop('checked')) {
  129. $.cookie("bottomliwu","true",{ expires : 99999})
  130. } else {
  131. $.cookie("bottomliwu","false",{ expires : 99999})
  132. }
  133. })
  134.  
  135. var liwu = ""
  136.  
  137.  
  138. //中间弹幕
  139. if($.cookie("centerdanmu") !== null){
  140. if($.cookie("centerdanmu") == "true"){
  141. $("#centerdanmu").attr("checked",true)
  142. }else{
  143. $("#centerdanmu").attr("checked",false)
  144. }
  145. }
  146.  
  147.  
  148. $("#centerdanmu").click(function () {
  149. if ($(this).prop('checked')) {
  150. $.cookie("centerdanmu","true",{ expires : 99999})
  151. } else {
  152. $.cookie("centerdanmu","false",{ expires : 99999})
  153. }
  154. })
  155. var hasclassdanmu
  156.  
  157.  
  158. //中间特效
  159. if($.cookie("centertexiao") !== null){
  160. if($.cookie("centertexiao") == "true"){
  161. $("#centertexiao").attr("checked",true)
  162. }else{
  163. $("#centertexiao").attr("checked",false)
  164. }
  165. }
  166.  
  167.  
  168. $("#centertexiao").click(function () {
  169. if ($(this).prop('checked')) {
  170. $.cookie("centertexiao","true",{ expires : 99999})
  171. } else {
  172. $.cookie("centertexiao","false",{ expires : 99999})
  173. }
  174. })
  175. var hasclasstexiao
  176.  
  177. //最高画质
  178. if($.cookie("tophuazhi") !== null){
  179. if($.cookie("tophuazhi") == "true"){
  180. $("#tophuazhi").attr("checked",true)
  181. }else{
  182. $("#tophuazhi").attr("checked",false)
  183. }
  184. }
  185.  
  186.  
  187. $("#tophuazhi").click(function () {
  188. if ($(this).prop('checked')) {
  189. $.cookie("tophuazhi","true",{ expires : 99999})
  190. } else {
  191. $.cookie("tophuazhi","false",{ expires : 99999})
  192. }
  193. })
  194.  
  195. setInterval(function () {
  196. //删除静态加载元素
  197. $("#J_spbg").remove();//移除网页头部Banner图
  198. //$("#J_roomHeader").remove();//移除直播间头部
  199. $(".room-gg-top").remove();//移除页面头部广告
  200. $("#J_roomHdR").remove();//移除直播间头部右侧订阅
  201. $(".room-core").css("width","70%");//直播间宽度
  202. $(".room-core").css("margin","0 auto");//直播间居中
  203. $(".sidebar-hide").remove();//移除左侧侧边栏
  204. $("#J_mainWrap").css("padding-left","0px");
  205. $("#match-cms-content").remove();//移除背景及底部内容
  206. $(".game--3vukE-yU-mjmYLSnLDfHYm").remove();//移除直播间头部广告
  207. $("huya-ab-fixed").remove();//移除直播间内广告
  208. $("#huya-ab").remove();//移除直播间内广告
  209. $(".room-gg-chat").remove();//移除右侧弹幕栏广告
  210. $(".diy-comps-wrap").remove();
  211.  
  212. //右侧弹幕栏开始
  213. if($.cookie("rightdanmu") == "true"){
  214. $(".room-core-l").css("margin-right","350px");//添加直播间右边距
  215. $(".room-core-r").css("display","block");//显示右侧聊天栏
  216. }else{
  217. $(".room-core-l").css("margin","0px");//去除直播间右边距
  218. $(".room-core-r").css("display","none");//隐藏右侧聊天栏
  219. }
  220. //右侧弹幕栏结束
  221.  
  222. $(".room-footer-l").remove();//移除底部主播动态
  223. $(".room-footer-r").remove();//移除签约公会
  224. $("#UDBSdkLgn").remove();//移除登录(不可用)弹出页
  225.  
  226. //删除动态加载元素
  227. $("#hy-watermark").remove();//移除直播号
  228. $("#player-subscribe-wap").remove();//移除直播间底部主播信息栏
  229.  
  230. //下方礼物栏开始
  231. if($.cookie("bottomliwu") == "true"){
  232. $(".player-gift-wrap").children().css("display","block");//添加直播间底部礼物栏
  233. }else{
  234. $(".player-gift-wrap").children().css("display","none");//移除直播间底部礼物栏
  235. }
  236. //下方礼物栏结束
  237.  
  238. $(".player-gift-wrap").css("background","#f7f7f7");//更改直播间底部礼物栏背景色
  239. $("#player-resource-wrap").remove();//移除直播间内广告
  240. $(".gift-info-wrap").remove();//移除直播间右侧礼物栏
  241. $(".duya-header-ad").remove();//移除标题中间广告
  242. $(".subscribe").remove();
  243.  
  244. //中间弹幕开始
  245. if($.cookie("centerdanmu") == "true"){
  246. hasclassdanmu = $("#player-danmu-btn").hasClass("player-ctrl-switch-hide");
  247. if(!hasclassdanmu){
  248.  
  249. }else{
  250. $("#player-danmu-btn").click();
  251. $(".player-danmu-pane").css("display","none")
  252. }
  253. }else{
  254. hasclassdanmu = $("#player-danmu-btn").hasClass("player-ctrl-switch-hide");
  255. if(!hasclassdanmu){
  256. $("#player-danmu-btn").click();
  257. }else{
  258.  
  259. }
  260. }
  261. //中间弹幕结束
  262.  
  263.  
  264. //中间特效开始
  265. if($.cookie("centertexiao") == "true"){
  266. hasclasstexiao = $("#shielding-effect").hasClass("shielding-effect-select")
  267. if(!hasclasstexiao){
  268.  
  269. }else{
  270. $(".shielding-effect-btn").click();
  271. }
  272. }else{
  273. hasclasstexiao = $("#shielding-effect").hasClass("shielding-effect-select")
  274. if(!hasclasstexiao){
  275. $(".shielding-effect-btn").click();
  276. }else{
  277.  
  278. }
  279. }
  280. //中间特效结束
  281.  
  282.  
  283. //最高画质开始
  284. if($.cookie("tophuazhi") == "true"){
  285. $(".player-videotype-list").find("li:first").click();//最高画质
  286. }else{
  287.  
  288. }
  289. //最高画质结束
  290.  
  291. //$("#danmudiv").remove();//移除弹幕
  292. //localStorage.loginTipsCount = -1e+35;
  293. //$('#player-login-tip-wrap').remove();
  294. //VPlayer.prototype.checkLogin(true);
  295. //$(".player-fullscreen-btn").click();//全屏播放
  296. },10)
  297. });
  298. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址