diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 13566b8..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/bilibili-linux.iml b/.idea/bilibili-linux.iml
deleted file mode 100644
index 2d93557..0000000
--- a/.idea/bilibili-linux.iml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
deleted file mode 100644
index a55e7a1..0000000
--- a/.idea/codeStyles/codeStyleConfig.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 29cae34..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/CHANGELOG.MD b/CHANGELOG.MD
index 4fa9ca7..36e6f58 100644
--- a/CHANGELOG.MD
+++ b/CHANGELOG.MD
@@ -1,3 +1,10 @@
+# 🌈 v1.16.2-3 / 2025-02-01
+
+## 🚀 功能
+
+- 弹幕:添加大会员彩色屏蔽功能。
+- 弹幕:更改等级屏蔽设置入口与生效逻辑。
+
# 🌈 v1.16.2-2 / 2025-01-15
## 🐞 修复
diff --git a/extensions/area_unlimit/hook/PlayerEnhance.html b/extensions/area_unlimit/hook/PlayerEnhance.html
index 7891709..af2105c 100644
--- a/extensions/area_unlimit/hook/PlayerEnhance.html
+++ b/extensions/area_unlimit/hook/PlayerEnhance.html
@@ -2,7 +2,7 @@
-
+
+
+
+ 屏蔽等级:
+
+
+
+
+
-
+
搜索:
diff --git a/extensions/area_unlimit/hook/player.js b/extensions/area_unlimit/hook/player.js
index 6000439..ac8df21 100644
--- a/extensions/area_unlimit/hook/player.js
+++ b/extensions/area_unlimit/hook/player.js
@@ -171,7 +171,7 @@ const sleep = (ms) => {
// danmakuManage.danmakuStore.loadDmPbAll(true)
return Promise.resolve(`成功加载${comments.length}条弹幕`)
- }
+ },
}
const UI = (()=>{
const init = ()=>{
@@ -281,6 +281,9 @@ const sleep = (ms) => {
dmTimelineDrawer: false,
moveFactor: 0,
dandanplayWithRelated: true,
+ // block level 屏蔽等级
+ blockLevel: 0,
+ isBlockVipColor: false,
};
},
created() {
@@ -293,6 +296,9 @@ const sleep = (ms) => {
UI.dmTimeline = ()=>{
this.dmTimelineDrawer = !this.dmTimelineDrawer
}
+ this.blockLevel = parseInt(localStorage.getItem('dm-filter-weight') || '0')
+ log.info('current weight:', this.weight)
+ this.isBlockVipColor = localStorage.getItem('dm-filter-blockvip') === 'true'
},
methods: {
doSearch: function(){
@@ -313,7 +319,7 @@ const sleep = (ms) => {
default:
break;
}
- HandleResult[this.activeName](this.selectOptions, data)
+ HandleResult[this.activeName]?.(this.selectOptions, data)
.then(res=>{
this.$message({
message: res,
@@ -347,6 +353,14 @@ const sleep = (ms) => {
dm.stime += time
});
}
+ },
+ watch: {
+ blockLevel(n, o) {
+ localStorage.setItem('dm-filter-weight', n)
+ },
+ isBlockVipColor(n, o) {
+ localStorage.setItem('dm-filter-blockvip', n)
+ },
}
};
const app = Vue.createApp(App);
@@ -416,83 +430,31 @@ const sleep = (ms) => {
speedRate.before(createElement(3.0))
speedRate.before(createElement(2.5))
{
- /**
- * @type {Element | null}
- */
- const speed = window.danmakuManage.nodes.controlBottomCenter.querySelector('.bpx-player-dm-setting-left-speedplus')
-
- const weightFilter = document.createElement('div')
- weightFilter.innerHTML = `
- `
- const valueText = weightFilter.querySelector('.bui-progress-val')
- const value = weightFilter.querySelector('.bui-progress-bar')
- const option = weightFilter.querySelector('.bui-progress-item')
let originalFilter = window.danmakuManage.danmaku.config.fn.filter
- const changeFilterWeight = (weight) => {
- if (weight > 10) weight = 10
- if (weight < 0) weight = 0
- localStorage.setItem('dm-filter-weight', weight)
-
- valueText.textContent = `${weight}级`
- value.style.width = `${weight * 10}%`
- if (weight < 5)
- {
- value.firstElementChild.style.transform = 'translate3d(10px, -4px, 0px)'
- }
- else {
- value.firstElementChild.style = {}
+ const customFilter = (t) => {
+ log.info('filter....')
+ if (originalFilter(t)){
+ // log.info('default block:', t.weight)
+ return true
}
-
- window.danmakuManage.danmaku.config.fn.filter = (t) => {
- // log.info('filter:', t)
- if (originalFilter(t)){
- // log.info('default block:', t.weight)
- return true
- }
- if (t.weight < weight) {
- // log.info('block weight:', t.weight)
+ if (localStorage.getItem('dm-filter-blockvip') === 'true')
+ {
+ // 屏蔽大会员彩色
+ if (t.colorful || t.colorfulImg) {
+ log.info('block vip', JSON.stringify(t, null, 4))
return true
}
- return false
+
}
+ const weight = parseInt(localStorage.getItem('dm-filter-weight') || '0')
+ if (t.weight <= weight) {
+ log.info('current weight:', weight)
+ log.info('block weight:', JSON.stringify(t, null, 4))
+ return true
+ }
+ return false
}
- let isDown = false
- const cal = (e) => {
- // log.info('click options', e)
- if (e.target.classList.contains('bui-progress-dot')) return
- const filterWeight = Math.round(e.offsetX / 160 * 10)
- // log.info('click result:', e.offsetX, filterWeight)
-
- changeFilterWeight(filterWeight)
- }
- option.parentElement.parentElement.onmousedown = (e) => {
- isDown = true
- cal(e)
- }
- option.parentElement.parentElement.onmouseup = () => {
- isDown = false
- }
- option.parentElement.parentElement.onmousemove = (e) => {
- if (isDown) cal(e)
- }
+ window.danmakuManage.danmaku.config.fn.filter = customFilter
{
const originalInitDanmaku = window.danmakuManage.initDanmaku
window.danmakuManage.initDanmaku = function () {
@@ -500,47 +462,10 @@ const sleep = (ms) => {
originalInitDanmaku.apply(this)
log.info('update filter...')
originalFilter = this.danmaku.config.fn.filter
- changeFilterWeight(parseInt(localStorage.getItem('dm-filter-weight') || '0'))
- {
- let check = setInterval(() => {
- /**
- 调整大小
- * @type {Element | null}
- */
- const left = document.querySelector('.bpx-player-dm-setting-left')
- if (left.parentElement.style.height === '340px')
- clearInterval(check)
- left.parentElement.style.height = '340px'
- left.parentElement.parentElement.parentElement.style.height = '340px'
- log.info('fix height end')
- }, 1000)
- }
+ window.danmakuManage.danmaku.config.fn.filter = customFilter
}
}
- changeFilterWeight(parseInt(localStorage.getItem('dm-filter-weight') || '0'))
- for (let i = 0; i <= 10; i++) {
- const newOption = option.cloneNode(true)
- newOption.style.left = `${i * 10}%`
- option.before(newOption)
- }
- option.remove()
- // log.info(weightFilter.firstElementChild)
- speed.after(weightFilter.firstElementChild)
- {
- let check = setInterval(() => {
- /**
- 调整大小
- * @type {Element | null}
- */
- const left = document.querySelector('.bpx-player-dm-setting-left')
- if (left.parentElement.style.height === '340px')
- clearInterval(check)
- left.parentElement.style.height = '340px'
- left.parentElement.parentElement.parentElement.style.height = '340px'
- log.info('fix height end')
- }, 1000)
- }
}
clearInterval(rate175check)
}catch(err){
diff --git a/tools/setup-bilibili b/tools/setup-bilibili
index 9ce73e6..69a8f61 100755
--- a/tools/setup-bilibili
+++ b/tools/setup-bilibili
@@ -16,6 +16,9 @@ notice() {
res_dir="$root_dir/tmp/bili/resources"
+cd $root_dir
+pnpm install
+
"$root_dir/tools/update-electron"
"$root_dir/tools/update-bilibili"
"$root_dir/tools/fix-other.sh"