B站弹幕hook

1.关闭智能云屏蔽 2.关闭高赞弹幕 3.关闭大会员弹幕

  1. // ==UserScript==
  2. // @name B站弹幕hook
  3. // @version 0.2
  4. // @description 1.关闭智能云屏蔽 2.关闭高赞弹幕 3.关闭大会员弹幕
  5. // @author DeltaFlyer
  6. // @copyright 2024, DeltaFlyer(https://github.com/DeltaFlyerW)
  7. // @license MIT
  8. // @match https://www.bilibili.com/video/*
  9. // @match https://www.bilibili.com/bangumi/play/*
  10. // @run-at document-start
  11. // @grant unsafeWindow
  12. // @icon https://www.biliplus.com/favicon.ico
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.0/jszip.min.js
  14. // @namespace https://gf.qytechs.cn/users/927887
  15. // ==/UserScript==
  16.  
  17.  
  18. if (!unsafeWindow.Map.prototype._set) {
  19. unsafeWindow.Map.prototype._set = unsafeWindow.Map.prototype.set
  20. unsafeWindow.Map.prototype.set = function (key, value) {
  21. if (key && key.danmakuStore) {
  22. let bpx_player = key
  23. if (!bpx_player.danmakuStore._fetchDmSeg) {
  24. unsafeWindow.bpx_player = window.bpx_player = bpx_player
  25. console.log(key, value)
  26. let danmakuStore = bpx_player.danmakuStore
  27. danmakuStore._fetchDmSeg = danmakuStore.fetchDmSeg
  28. danmakuStore.fetchDmSeg = async function () {
  29. let result = await danmakuStore._fetchDmSeg(...arguments)
  30. try{
  31. for (let danmaku of result.details.elems) {
  32. danmaku.weight = 11 // 关闭智能云屏蔽
  33. danmaku.attr = 1048576 // 关闭高赞弹幕
  34. danmaku.colorful = undefined // 关闭大会员弹幕
  35. }
  36. }
  37. catch(e){
  38. console.log(e)
  39. }
  40. console.log(result)
  41. return result
  42. }
  43. }
  44. }
  45. this._set(key, value)
  46. }
  47. }
  48.  

QingJ © 2025

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