BiliPlus 优化版

哔哩哔哩错误视频自动跳转

Version au 08/11/2022. Voir la dernière version.

  1. // ==UserScript==
  2. // @name BiliPlus 优化版
  3. // @namespace https://www.biliplus.com
  4. // @version 1.13.22
  5. // @description 哔哩哔哩错误视频自动跳转
  6. // @author 蓝云
  7. // @icon https://www.biliplus.com/favicon.ico
  8. // @license MIT
  9. // @include http*://*.bilibili.com/*
  10.  
  11. // @require https://code.jquery.com/jquery-latest.js
  12.  
  13. // @run_at document_idle
  14. // ==/UserScript==
  15. //视频跳转
  16. $(window).load(function () {
  17. let body = $('body');
  18.  
  19. if ($('.error-container').length > 0)
  20. location.replace(location.href.replace(/\:\/\/www\.bilibili\.com\/video/, '://www.biliplus.com/video'));
  21. if ($('.video-list-status-text').length > 0)
  22. location.replace(location.href.replace(/\:\/\/bangumi\.bilibili\.com\/anime/, '://www.biliplus.com/bangumi/i'));
  23. if ($('.player-limit-wrap').length > 0)
  24. location.replace(location.href.replace(/\:\/\/www\.bilibili\.com/, '://www.biliplus.com'));
  25.  
  26.  
  27. //收藏夹跳转
  28. body.mouseover(function () {
  29. $('.small-item.disabled').each(function () {
  30. $(this).removeClass('disabled');
  31. $(this).find('a').attr('href', 'https://www.biliplus.com/video/' + $(this).attr('data-aid'));
  32. });
  33.  
  34. });
  35.  
  36.  
  37.  
  38. //主菜单修改
  39. addCss(`
  40. #home_popularize {
  41. height: 48px;
  42. display: flex;
  43. align-items: center;
  44. margin-right: 0;
  45. margin-left: 14px;
  46. }
  47. @media screen and (min-width: 1400px) {
  48. #home_popularize {
  49. margin-left: 32px;
  50. }
  51. }`, 'Popularize');
  52.  
  53.  
  54. if (orginPopularize.length > 0) {
  55.  
  56.  
  57.  
  58.  
  59. }
  60.  
  61. //顶部修改
  62. addCss(`
  63. .bili-wrapper {
  64. margin: 16px auto;
  65. }
  66. .nav-item.live .i-frame,
  67. .nav-item {
  68. display: none !important;
  69. pointer-events: none !important;
  70. }
  71. .nav-item.home,
  72. .nav-item.hbili,
  73. .nav-item.mbili,
  74. .nav-item.live,
  75. .nav-con.fr .nav-item {
  76. display: list-item !important;
  77. pointer-events: all !important;
  78. }
  79. .nav-con.fr .nav-item[report-id="playpage_VIP"] {
  80. display: none !important;
  81. pointer-events: none !important;
  82. }`, 'Top');
  83.  
  84. /*视频页面*/
  85. addCss(`
  86. .app-download,
  87. #playpage_mobileshow,
  88. #arc_toolbar_report .tb-line,
  89. #live_recommand_report{
  90. display: none !important;
  91. pointer-events: none !important;
  92. }`,'Video');
  93.  
  94. /**
  95. * 添加style到head
  96. * @param css css内容
  97. * @param name style标识
  98. */
  99. function addCss(css, name) {
  100. let style = body.find("style[data-meta='" + name + "']:first");
  101. if (style.length === 0) {
  102. }
  103. style.text(style.text() + css);
  104. style.attr("data-meta", name);
  105. body.append(style);
  106. }
  107. });