Better Live UX

自动选择最高清晰度、禁止弹幕、禁止广告。

  1. // ==UserScript==
  2. // @name Better Live UX
  3. // @name:zh-CN 更好的直播体验(最高清晰度、禁弹幕、禁广告)
  4. // @namespace lhzbxx
  5. // @version 2022.05.11
  6. // @description 自动选择最高清晰度、禁止弹幕、禁止广告。
  7. // @author lhzbxx
  8. // @run-at document-idle
  9. // @noframes
  10. // @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/1.12.4/jquery.min.js
  11. // @require https://gf.qytechs.cn/scripts/383527-wait-for-key-elements/code/Wait_for_key_elements.js?version=701631
  12. // @match *://live.bilibili.com/*
  13. // @match *://www.douyu.com/*
  14. // @match *://www.huya.com/*
  15. // @match *://egame.qq.com/*
  16. // @license MIT
  17. // ==/UserScript==
  18.  
  19. const config = {
  20. huya: {
  21. init: () => {
  22. waitForKeyElements('div[class^="FanClubHd"]', (node) => {
  23. node[0].dispatchEvent(new MouseEvent('mouseover', {bubbles: true}));
  24. waitForKeyElements('span[class^="SignBtn"]', (cNode) => {
  25. cNode.click();
  26. });
  27. setTimeout(() => {
  28. node[0].dispatchEvent(new MouseEvent('mouseout', {bubbles: true}));
  29. }, 500);
  30. });
  31. },
  32. selectors: [
  33. '#player-danmu-btn[title="关闭弹幕"]',
  34. 'ul.player-videotype-list > li:nth-child(1)',
  35. 'div.ab-close-btn',
  36. // '#player-fullpage-btn',
  37. ],
  38. timeout: 2400,
  39. },
  40. douyu: {
  41. selectors: [
  42. `div[class^='showdanmu-']`,
  43. `div[class^='tip-'] > ul > li:nth-child(1)`,
  44. // `div[class^='wfs']:not([class^='wfs-exit'])`,
  45. ],
  46. },
  47. bilibili: {
  48. init: () => {
  49. waitForKeyElements('#live-player', (node) => {
  50. node[0].dispatchEvent(new MouseEvent('mousemove'));
  51. });
  52. waitForKeyElements('.quality-wrap', (node) => {
  53. node[0].dispatchEvent(new MouseEvent('mouseenter'));
  54. setTimeout(() => {
  55. node[0].dispatchEvent(new MouseEvent('mouseleave'));
  56. }, 1200);
  57. });
  58. },
  59. selectors: [
  60. '.quality-wrap > div > div.quality-it:nth-child(2)',
  61. // 'div.danmaku',
  62. ],
  63. },
  64. qq: {
  65. selectors: [
  66. 'div.vcp-extended-barrage',
  67. 'a.vcp-vertical-switcher-item-clarity:nth-child(1)',
  68. // 'div.vcp-extended-webfullscreen',
  69. ],
  70. },
  71. }
  72.  
  73. const site = config[document.domain.split('.').reverse()[1]];
  74.  
  75. (function() {
  76. 'use strict';
  77.  
  78. if (!site) {
  79. return;
  80. }
  81.  
  82. site.init && site.init();
  83. site.selectors.forEach(selector => {
  84. setTimeout(() => {
  85. waitForKeyElements(selector, (node) => {
  86. node.click();
  87. });
  88. }, site.timeout || 0);
  89. });
  90. })();

QingJ © 2025

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