Skip to content

Commit

Permalink
Merge pull request #27 from festoney8/dev
Browse files Browse the repository at this point in the history
merge dev to main, v3.0.3
  • Loading branch information
festoney8 authored Jan 24, 2024
2 parents 62c739d + 3c414ae commit e0f2283
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 3.0.3

- 新增:播放页 隐藏投票栏、隐藏评论区用户投票状态
- 新增:播放页 交换视频信息和播放器的顺序

## 3.0.2

- 新增:右键菜单新增 添加UP主到白名单
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,22 @@

### 过滤视频

- **注意:功能目前处于测试阶段,仅供体验,不保证功能生效、不保证屏蔽记录稳定性**
- 支持过滤页面「首页、播放页、热门页(热门视频/每周必看/排行榜)」
- 支持「UP主、BV号、标题关键词、视频时长」共 4 种过滤模式,支持同时启用
- 视频过滤功能实时生效
- 每个页面的功能开关相互独立
- **注意:过滤功能仍处于测试阶段**
- **如果屏蔽列表添加了大量内容,请定时备份插件数据**
- 支持「首页、播放页、热门页(热门视频/每周必看/排行榜)」共 3 个页面
- 支持「UP主、BV号、标题关键词、视频时长」共 4 种过滤模式
- 黑名单、白名单全站通用,**一次屏蔽,全站隐藏**(只要开关开启就会隐藏)
- 白名单权限高于黑名单,命中白名单的视频不会被隐藏
- 「标题关键词过滤」功能的黑/白名单大小写不敏感,二者均支持正则表达式
> 正则语句需使用 `/ ... /` 括起来,如 `/abc|d|e/`。反斜杠使用单斜杠,如 `/\d+/`。正则为 iv 模式,大小写不敏感。
- Tips:
- 注意:屏蔽 UP 主时,不要反复点开他们的视频和个人页,推荐系统会误认为你喜欢,导致推送变差
- 时长过滤不宜设定过长,会丢失掉好视频,推荐设定 60~90 秒
- 屏蔽经常出现的 UP 主可以让「热门视频、每周必看、排行榜」变得非常舒服
- 由于白名单的高权限,编写白名单关键词请注意影响面,会导致命中白名单的低质量视频被强制显示出来
- 编写正则表达式请小心,可能造成大量视频被屏蔽
- 遇到每期必看的高质量 UP 主,可以顺手把他们加入白名单
- 屏蔽视频时会在 Console 输出日志,按 F12 查看日志

### 快捷键

Expand Down Expand Up @@ -203,5 +212,12 @@

## Contribution

- main branch 用于发布测试版和稳定版
- main branch 只用于发布测试版和稳定版
- dev branch 用于开发

<details>
<summary>视频过滤流程</summary>

![](images/filter-flowchart.jpg)

</details>
Binary file added images/filter-flowchart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions src/rules/video.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,27 @@ if (isPageVideo() || isPagePlaylist()) {
`.fixed-header .bili-header__bar {position: relative !important;}`,
),
)
// 播放器和视频信息 交换位置(实验性)
basicItems.push(
new CheckboxItem(
'video-page-exchange-player-position',
'播放器和视频信息 交换位置(实验性)',
false,
undefined,
false,
`.left-container {
display: flex !important;
flex-direction: column !important;
padding-top: 50px !important;
}
#viewbox_report {order: 2;}
#playerWrap {order: 1;}
#arc_toolbar_report {order: 3;}
.left-container-under-player {order: 4;}
.video-info-container {height: unset !important; padding-top: 16px !important;}
.video-toolbar-container {padding-top: 12px !important;}`,
),
)
}
videoGroupList.push(new Group('video-basic', '播放页 基本功能', basicItems))

Expand Down Expand Up @@ -896,6 +917,17 @@ if (isPageVideo() || isPagePlaylist()) {
`#bannerAd {display: none !important;}`,
),
)
// 隐藏 投票
toolbarItems.push(
new CheckboxItem(
'video-page-hide-top-vote-card',
'隐藏 投票',
false,
undefined,
false,
`.comment-container .top-vote-card {display: none !important;}`,
),
)
}
videoGroupList.push(new Group('video-toolbar', '视频下方 工具/简介/Tag', toolbarItems))

Expand Down Expand Up @@ -1324,6 +1356,17 @@ if (isPageVideo() || isPagePlaylist()) {
.comment-container .bili-avatar-icon {display: none !important;}`,
),
)
// 隐藏 用户投票 (红方/蓝方)
commentItems.push(
new CheckboxItem(
'video-page-hide-vote-info',
'隐藏 用户投票 (红方/蓝方)',
false,
undefined,
false,
`.comment-container .vote-info {display: none !important;}`,
),
)
// 隐藏 评论内容下tag(UP觉得很赞)
commentItems.push(
new CheckboxItem(
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '3.0.1',
version: '3.0.3',
description:
'净化 B站/哔哩哔哩 页面内各种元素,去广告,BV号转AV号,净化播放器,提供300+项功能,定制自己的B站页面',
author: 'festoney8',
Expand Down

0 comments on commit e0f2283

Please sign in to comment.