PureLive

移除直播网站广告

  1. // ==UserScript==
  2. // @name PureLive
  3. // @version 1.0.9
  4. // @description:zh-cn 移除直播网站广告
  5. // @namespace Violentmonkey Scripts
  6. // @include https://www.zhanqi.tv/*
  7. // @exclude https://www.zhanqi.tv/topic/*
  8. // @include https://www.showroom-live.com/*
  9. // @include https://live.bilibili.com/*
  10. // @include https://www.douyu.com/*
  11. // @exclude https://www.douyu.com/
  12. // @grant none
  13. // @description 移除直播网站广告
  14. // ==/UserScript==
  15.  
  16. /**
  17. * WARNING
  18. * 本脚本仅支持 Violentmonkey Scripts
  19. */
  20. $(document).ready(() => {
  21. const applyCSS = (css) => {
  22. let styleTag = $(css);
  23. $('html > head').append(styleTag);
  24. }
  25. const zhanqi = () => {
  26. $('.live-chat-content').remove(); // 聊天窗口
  27. $('.live-side-content').remove(); // 左侧边栏
  28. $('.want-headlines-btn').remove(); // 上头条
  29. $('.js-room-fun-area').remove(); // 礼物区域
  30. $('.sdk-zhanqiMall').remove(); // 商城按钮
  31. $('.anchor-info-area').remove(); // 主播信息
  32. $('.hot-tg').remove(); // 热门推广
  33. applyCSS(`<style>
  34. .no-play-down-ibox {display: none !important;} /* 客户端下载广告 */
  35. #js-flash-layer {width: 99vw !important; height: 100vh !important;} /* 拉伸播放器 */
  36. .live-room-content {padding: 0 !important;} /* 砍掉主容器左内间距 */
  37. .sdk-zhanqiMall {display: none !important;} /* 商城按钮 */
  38. .room-rank-ibox,.ranking-btn {display: none !important;} /* 排名展示和排名按钮 */
  39. .zb-task .zb-task-entrance { display: none !important } /* 主播任务 */
  40. .shrink-icon { display: none !important } /* 主播任务 */
  41. </style>`);
  42. $(window).trigger('resize');
  43. }
  44.  
  45. const showroom = () => {
  46. applyCSS(`<style>
  47. #js-avatar { display: none !important; } /* 垃圾头像 */
  48. #gift-area, #gift-log { display: none !important; } /* 礼物区域 */
  49. #event-and-support-area { display: none !important; } /* 活动和赞助区域 */
  50. .l-room-footer { display: none !important; } /* 底栏 */
  51. .remove-background {background-image: none !important;} /* 垃圾背景图 */
  52. .l-publicity-banner { display: none !important; } /* banner */
  53. .l-room-video {left: 0 !important; margin-left: 0;} /* 以下三行是拉伸播放器 */
  54. #js-room-video { width: auto !important; height: auto !important;}
  55. #js-video { width: 99vw !important; height: 70vh !important;}
  56. #js-room-comment-wrapper { top: 85vh !important; opacity: 0.5; } /* 调整评论框位置 */
  57. #js-room-comment-wrapper:hover { opacity: 1 }
  58. .l-room-youtube { text-align: center; }
  59. </style>`);
  60. $('.room-inner').addClass('remove-background');
  61. // 背景太黑 所以搞个自定义背景
  62. $('.l-wrapper').on(
  63. 'dragover',
  64. function (e) {
  65. e.preventDefault();
  66. e.stopPropagation();
  67. }
  68. )
  69. $('.l-wrapper').on(
  70. 'dragenter',
  71. function (e) {
  72. e.preventDefault();
  73. e.stopPropagation();
  74. }
  75. )
  76. $('.l-wrapper').on(
  77. 'drop',
  78. function (e) {
  79. if (e.originalEvent.dataTransfer) {
  80. if (e.originalEvent.dataTransfer.files.length) {
  81. e.preventDefault();
  82. e.stopPropagation();
  83. const fileReader = new FileReader();
  84. fileReader.readAsDataURL(e.originalEvent.dataTransfer.files[0]);
  85. fileReader.onloadend = () => {
  86. $('.room-inner').removeClass('remove-background');
  87. $('#js-room-section').removeAttr('style');
  88. $('#js-room-section').css('background-image', `url(${fileReader.result})`);
  89. }
  90. }
  91. }
  92. }
  93. );
  94. }
  95.  
  96. const bilibili = () => {
  97. applyCSS(`<style>
  98. .bilibili-live-player-video-gift { display: none !important; } /* 覆盖播放器的礼物横幅 */
  99. .gift-content, .gift-prefix {display: none !important;} /* 覆盖播放器的礼物横幅 */
  100. </style>`)
  101. }
  102.  
  103. const douyu = () => {
  104. applyCSS(`<style>
  105. .left-menu { display: none !important; } /* 弱智左边栏 */
  106. #js-stats-and-actions { display: none !important; } /* 礼物投喂和任务 */
  107. #js-live-room-normal-right { display: none !important; } /* 聊天区域 */
  108. #anchor-info { display: none !important; } /* 主播信息 */
  109. #header { display: none !important; } /* 顶栏 */
  110. #container { margin-top: -50px; } /* 填补顶栏 */
  111. #mainbody { margin-left: 0 !important; padding: 0 !important; } /* 播放器拉伸 填补 */
  112. #js-room-video { margin: 0 !important; overflow: visible !important;}
  113. #douyu_room_normal_flash_proxy_box, #douyu_room_normal_flash_proxy_box object, #douyu_room_normal_flash_proxy_box video { width: 99vw; height: 100vh; }
  114. .room-ad-top { display: none !important; } /* 顶部广告 */
  115. .noble-face-wrap { display: none !important; } /* 贵族主播活动 */
  116. </style>`)
  117. }
  118.  
  119. switch (location.host) {
  120. case 'www.zhanqi.tv':
  121. case 'zhanqi.tv':
  122. zhanqi(); break;
  123. case 'www.showroom-live.com':
  124. showroom(); break;
  125. case 'live.bilibili.com':
  126. bilibili(); break;
  127. case 'douyu.com':
  128. case 'www.douyu.com':
  129. douyu(); break;
  130. }
  131. });

QingJ © 2025

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