b站视频播放加速

提高b站视频播放速度上限

  1. // ==UserScript==
  2. // @name b站视频播放加速
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description 提高b站视频播放速度上限
  6. // @author ElZhao
  7. // @match https://www.bilibili.com/video/*
  8. // @icon https://www.google.com/s2/favicons?domain=bilibili.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. function hack() {
  16. for (let node of document.querySelectorAll('li.bilibili-player-video-btn-speed-menu-list')) {
  17. let value = node.getAttribute('data-value') * 2
  18. if (value) {
  19. node.setAttribute('data-value', value);
  20. node.textContent = node.getAttribute('data-value');
  21. node.setAttribute('style', 'color:rgb(255, 255, 255)')
  22. }
  23. }
  24. document.querySelector('li.fuckers').textContent = '复原'
  25. document.querySelector('li.fuckers').setAttribute('onclick', 'restore()')
  26. }
  27.  
  28. function restore() {
  29. for (let node of document.querySelectorAll('li.bilibili-player-video-btn-speed-menu-list')) {
  30. let value = node.getAttribute('data-value') / 2
  31. if (value) {
  32. node.setAttribute('data-value', value);
  33. node.textContent = node.getAttribute('data-value');
  34. node.removeAttribute('style')
  35. }
  36. }
  37. document.querySelector('li.fuckers').textContent = '提速'
  38. document.querySelector('li.fuckers').setAttribute('onclick', 'hack()')
  39. }
  40. setTimeout(() => {
  41. var script = document.createElement("script");
  42. script.type = "text/javascript";
  43. script.text += hack.toString();
  44. script.text += restore.toString();
  45. document.body.appendChild(script);
  46. setInterval(() => {
  47. let node = document.querySelector('ul.bilibili-player-video-btn-speed-menu li.fuckers')
  48. if (node == null) {
  49. document.querySelector('ul.bilibili-player-video-btn-speed-menu').insertAdjacentHTML('beforeend', '<li class="bilibili-player-video-btn-speed-menu-list fuckers" onclick="hack()">提速</li>');
  50. }
  51. }, 1000)
  52. }, 2000);
  53. })();

QingJ © 2025

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