karin-plugin-kkk 1.1.9 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # 变更日志
2
2
 
3
+ ## [1.1.11](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.1.10...v1.1.11) (2025-04-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **bilibili:** 屏蔽词/标签支持对转发动态的子动态进行检测 ([d3adc55](https://github.com/ikenxuan/karin-plugin-kkk/commit/d3adc552663d709675c763ff53594461f9d58f1d))
9
+ * 前端配置添加更多说明 ([e39ecad](https://github.com/ikenxuan/karin-plugin-kkk/commit/e39ecadc4b1a251bf626e998ada09e79dac4e039))
10
+
11
+ ## [1.1.10](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.1.9...v1.1.10) (2025-04-05)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * ci ([9d2a907](https://github.com/ikenxuan/karin-plugin-kkk/commit/9d2a907aee3e868b58f78eafddff5402f4cbabab))
17
+ * **config:** 将禁用词汇设置改为禁用标签设置 ([0454751](https://github.com/ikenxuan/karin-plugin-kkk/commit/0454751ccb8e93d5bb68996468ded5cb1c59f5f0))
18
+
3
19
  ## [1.1.9](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.1.8...v1.1.9) (2025-03-29)
4
20
 
5
21
 
package/README.md CHANGED
@@ -1,77 +1,59 @@
1
1
  # karin-plugin-kkk
2
- 🦄 **_Karin 的「抖音」「B站」「快手」视频解析/动态推送插件_**
2
+
3
+ 🦄 **_Karin 的「抖音」「B 站」「快手」视频解析/动态推送插件_**
3
4
 
4
5
  PS: 快手暂不支持推送
5
6
 
6
7
  ## ⬇️ 安装
7
8
 
8
- * 使用 **`包管理器`** 安装(非常推荐)
9
+ - 使用 **`包管理器`** 安装(非常推荐)
9
10
  <details>
10
11
  <summary>点击展开</summary>
11
12
 
12
- 在 **Karin 根目录** 下运行
13
- ```sh
14
- pnpm add karin-plugin-kkk@latest -w
15
- ```
13
+ 在 **Karin 根目录** 下运行
14
+
15
+ ```sh
16
+ pnpm add karin-plugin-kkk@latest -w
17
+ ```
18
+
16
19
  </details>
17
20
 
18
21
  <br />
19
22
 
20
- * 克隆编译产物 **`build 分支`**(比较推荐)
23
+ - 克隆编译产物 **`build 分支`**(比较推荐)
21
24
  <details>
22
25
  <summary>点击展开</summary>
23
26
 
24
- 1. 克隆源码
25
- ```sh
26
- git clone --depth=1 -b build https://github.com/ikenxuan/karin-plugin-kkk.git ./plugins/karin-plugin-kkk/
27
- ```
27
+ 1. 克隆源码
28
+
29
+ ```sh
30
+ git clone --depth=1 -b build https://github.com/ikenxuan/karin-plugin-kkk.git ./plugins/karin-plugin-kkk/
31
+ ```
32
+
28
33
  <details>
29
34
  <summary>如果你的 git 无法访问至 Github...点击打开查看解决方法</summary>
30
35
 
31
- > 若克隆无法连接到 Github,可以使用 GitHub Proxy 提供的镜像加速克隆
32
- > 建议收藏 [GitHub Proxy 最新地址发布](https://ghproxy.link/) 站点,以免镜像站被 GFW 封锁导致克隆失败
33
- > ```sh
34
- > git clone --depth=1 -b build https://ghgo.xyz/https://github.com/ikenxuan/karin-plugin-kkk.git ./plugins/karin-plugin-kkk/
35
- > ```
36
+ > 若克隆无法连接到 Github,可以使用 GitHub Proxy 提供的镜像加速克隆
37
+ > 建议收藏 [GitHub Proxy 最新地址发布](https://ghproxy.link/) 站点,以免镜像站被 GFW 封锁导致克隆失败
38
+ >
39
+ > ```sh
40
+ > git clone --depth=1 -b build https://ghgo.xyz/https://github.com/ikenxuan/karin-plugin-kkk.git ./plugins/karin-plugin-kkk/
41
+ > ```
36
42
 
37
43
  </details>
38
44
  <br>
39
45
 
40
- 2. 安装依赖
41
- 安装依赖,在 **Karin 根目录** 下运行
42
- ```sh
43
- pnpm install --filter=karin-plugin-kkk
44
- ```
46
+ 2. 安装依赖
47
+ 安装依赖,在 **Karin 根目录** 下运行
48
+
49
+ ```sh
50
+ pnpm install --filter=karin-plugin-kkk
51
+ ```
45
52
 
46
53
  </details>
47
54
 
48
55
  <br />
49
56
 
50
- * 使用 Release **`发行版`**(不推荐)
51
- <details>
52
- <summary>点击展开</summary>
53
-
54
- <p style="color: red; font-weight: 700;">不推荐该方式,后续只能重复下载 Release 包进行更新,且无法通过 Git 或 包管理器 进行更新</p>
55
-
56
- 1. 打开 Release 页面: https://github.com/ikenxuan/karin-plugin-kkk/releases
57
- 2. 找到最新的版本,下载名为 `build.zip` 的压缩包
58
- 3. 在 `plugins/` 目录下解压该压缩包,选择替换所有文件。
59
-
60
- * 完成后相关源码应在 `Karin根目录/plugins/karin-plugin-kkk/` 内<br><br>
61
-
62
- 解压完成后在插件目录下运行
63
- ```sh
64
- pnpm install
65
- ```
66
-
67
- 或者在 **Karin 根目录** 下运行
68
- ```sh
69
- pnpm install --filter=karin-plugin-kkk
70
- ```
71
-
72
- </details>
73
-
74
-
75
57
  ## 📖 功能
76
58
 
77
59
  **更多信息可打开 [文档主页](https://ikenxuan.github.io/karin-plugin-kkk/) 阅读。**<br>
@@ -84,36 +66,46 @@ PS: 快手暂不支持推送
84
66
 
85
67
  1. [fork](https://github.com/ikenxuan/karin-plugin-kkk/fork) 本项目到自己的仓库
86
68
  2. 克隆到本地
69
+
87
70
  ```sh
88
71
  git clone https://github.com/你的GitHub用户名/karin-plugin-kkk.git
89
72
  ```
73
+
90
74
  3. 进入项目目录
75
+
91
76
  ```sh
92
77
  cd karin-plugin-kkk/
93
78
  ```
79
+
94
80
  4. 初始化开发环境
81
+
95
82
  ```sh
96
83
  pnpm run init
97
84
  ```
85
+
98
86
  5. 安装依赖
87
+
99
88
  ```sh
100
89
  pnpm install
101
90
  ```
102
- 6. 启动开发环境
91
+
92
+ 6. 启动开发环境
93
+
103
94
  ```sh
104
95
  pnpm dev
105
96
  ```
97
+
106
98
  </details>
107
99
 
108
100
  ## 🌟 贡献者
109
101
 
110
- > 🌟星光闪烁,你们的智慧如同璀璨的夜空。感谢所有为 **karin-plugin-kkk** 做出贡献的人!
102
+ > 🌟 星光闪烁,你们的智慧如同璀璨的夜空。感谢所有为 **karin-plugin-kkk** 做出贡献的人!
111
103
 
112
104
  <a href="https://github.com/ikenxuan/karin-plugin-kkk/graphs/contributors">
113
105
  <img src="https://contrib.rocks/image?repo=ikenxuan/karin-plugin-kkk" />
114
106
  </a>
115
107
 
116
- ![Alt](https://repobeats.axiom.co/api/embed/76efd64f02ce043df06e2cd21913a0981b87f069.svg "Repobeats analytics image")
108
+ ![Alt](https://repobeats.axiom.co/api/embed/76efd64f02ce043df06e2cd21913a0981b87f069.svg 'Repobeats analytics image')
117
109
 
118
110
  ## Star History
119
111
 
@@ -126,6 +118,7 @@ pnpm dev
126
118
  </a>
127
119
 
128
120
  ## 😊 鸣谢
121
+
129
122
  **业务站点**
130
123
 
131
124
  - [www.douyin.com](https://www.douyin.com) & [www.bilibili.com](https://www.bilibili.com) & [www.kuaishou.com](https://www.kuaishou.com)
@@ -148,9 +141,11 @@ pnpm dev
148
141
  - 更多待补充...
149
142
 
150
143
  **友情链接**
144
+
151
145
  - Karin 框架 [**GitHub**](https://github.com/Karinjs/Karin) | [**文档**](https://karin.fun)
152
146
 
153
147
  ## 🧷 许可证
148
+
154
149
  [**GPL-3.0**](./LICENSE)
155
150
 
156
151
  ## ❗ 声明
@@ -341,13 +341,13 @@ export class Bilibilipush extends Base {
341
341
  const willbepushlist = {};
342
342
  try {
343
343
  for (const item of userList) {
344
- const dynamic_list = await this.amagi.getBilibiliData('用户主页动态列表数据', { host_mid: item.host_mid });
344
+ const dynamic_list = await this.amagi.getBilibiliData('用户主页动态列表数据', { host_mid: item.host_mid, typeMode: 'strict' });
345
345
  if (dynamic_list.data.items.length > 0) {
346
346
  // 遍历接口返回的视频列表
347
347
  for (const dynamic of dynamic_list.data.items) {
348
348
  const now = Date.now();
349
349
  // B站的是秒为单位的时间戳,需要乘 1000 转为毫秒
350
- const createTime = parseInt(dynamic.modules.module_author.pub_ts);
350
+ const createTime = dynamic.modules.module_author.pub_ts;
351
351
  const timeDifference = (now - createTime * 1000);
352
352
  const is_top = dynamic.modules.module_tag?.text === '置顶'; // 是否为置顶
353
353
  let shouldPush = false; // 是否列入推送数组
@@ -616,7 +616,7 @@ function br(data) {
616
616
  function checkvip(member) {
617
617
  // 根据VIP状态选择不同的颜色显示成员名称
618
618
  return member.vip.vipStatus === 1
619
- ? `<span style="color: ${member.vip.nickname_color || '#FB7299'}; font-weight: 700;">${member.name}</span>`
619
+ ? `<span style="color: ${member.vip.nickname_color ?? '#FB7299'}; font-weight: 700;">${member.name}</span>`
620
620
  : `<span style="color: ${Common.useDarkTheme() ? '#EDEDED' : '#606060'}">${member.name}</span>`;
621
621
  }
622
622
  /**
@@ -646,6 +646,12 @@ const skipDynamic = (Dynamic_Data) => {
646
646
  logger.mark(`动态:${logger.green(`https://t.bilibili.com/${Dynamic_Data.id_str}`)} 包含屏蔽词:「${logger.red(banWord)}」,跳过推送`);
647
647
  return true;
648
648
  }
649
+ if (Dynamic_Data.type === "DYNAMIC_TYPE_FORWARD" && 'orig' in Dynamic_Data) {
650
+ if (Dynamic_Data.orig.modules.module_dynamic.major?.archive?.title.includes(banWord) || Dynamic_Data.orig.modules.module_dynamic.desc?.text?.includes(banWord)) {
651
+ logger.mark(`转发动态:${`https://t.bilibili.com/${Dynamic_Data.id_str}`} 的子动态 ${logger.green(`https://t.bilibili.com/${Dynamic_Data.orig.id_str}`)} 包含屏蔽词:「${logger.red(banWord)}」,跳过推送`);
652
+ return true;
653
+ }
654
+ }
649
655
  }
650
656
  if (Dynamic_Data.type === DynamicType.DRAW || Dynamic_Data.type === DynamicType.FORWARD) {
651
657
  for (const banTag of Config.bilibili.push.banTags) {
@@ -655,6 +661,14 @@ const skipDynamic = (Dynamic_Data) => {
655
661
  return true;
656
662
  }
657
663
  }
664
+ if (Dynamic_Data.type === "DYNAMIC_TYPE_FORWARD" && 'orig' in Dynamic_Data) {
665
+ for (const tag of Dynamic_Data.orig.modules.module_dynamic.desc.rich_text_nodes) {
666
+ if (tag.orig_text.includes(banTag)) {
667
+ logger.mark(`转发动态:${`https://t.bilibili.com/${Dynamic_Data.id_str}`} 的子动态 ${logger.green(`https://t.bilibili.com/${Dynamic_Data.orig.id_str}`)} 包含屏蔽标签:「${logger.red(banTag)}」,跳过推送`);
668
+ return true;
669
+ }
670
+ }
671
+ }
658
672
  }
659
673
  }
660
674
  return false;
@@ -5,6 +5,7 @@ import { douyinConfig } from './douyin.js';
5
5
  import { kuaishouConfig } from './kuaishou.js';
6
6
  import { pushlistConfig } from './pushlist.js';
7
7
  import { uploadConfig } from './upload.js';
8
+ /** 插件配置类型 */
8
9
  export interface ConfigType {
9
10
  /** 插件应用设置 */
10
11
  app: appConfig;
package/lib/web.config.js CHANGED
@@ -124,6 +124,7 @@ export default {
124
124
  radio: [
125
125
  components.radio.create('Theme-1', {
126
126
  label: '自动',
127
+ description: '06:00-18:00为浅色,18:00-06:00为深色',
127
128
  value: '0'
128
129
  }),
129
130
  components.radio.create('Theme-2', {
@@ -202,7 +203,7 @@ export default {
202
203
  label: '作品中有指定标签时,不推送',
203
204
  maxRows: 2,
204
205
  itemsPerRow: 4,
205
- data: all.douyin.push.banWords,
206
+ data: all.douyin.push.banTags,
206
207
  template: components.input.string('push:banTags', {
207
208
  placeholder: '',
208
209
  label: '',
@@ -251,15 +252,17 @@ export default {
251
252
  defaultSelected: all.douyin.push.log
252
253
  }),
253
254
  components.radio.group('push:shareType', {
254
- label: '分享链接二维码的类型',
255
+ label: '推送图二维码的类型',
255
256
  orientation: 'horizontal',
256
257
  defaultValue: all.douyin.push.shareType,
257
258
  radio: [
258
259
  components.radio.create('push:shareType.radio-1', {
259
260
  label: '网页链接',
261
+ description: '识别后访问抖音官网对应的作品地址',
260
262
  value: 'web'
261
263
  }),
262
264
  components.radio.create('push:shareType.radio-2', {
265
+ description: '识别后访问无水印作品下载地址',
263
266
  label: '下载链接',
264
267
  value: 'download'
265
268
  })
@@ -331,7 +334,7 @@ export default {
331
334
  label: '动态中有指定标签时,不推送',
332
335
  maxRows: 2,
333
336
  itemsPerRow: 4,
334
- data: all.bilibili.push.banWords,
337
+ data: all.bilibili.push.banTags,
335
338
  template: components.input.string('push:banTags', {
336
339
  placeholder: '',
337
340
  label: '',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "karin-plugin-kkk",
3
- "version": "1.1.9",
4
- "description": "a Karin video parsing tool",
3
+ "version": "1.1.11",
4
+ "description": "Karin 的「抖音」「B 站」视频解析/动态推送插件",
5
5
  "keywords": [
6
6
  "karin-plugin",
7
7
  "karin"
@@ -33,12 +33,12 @@
33
33
  "clean": "npm lib/cli/pr.js clean",
34
34
  "commit": "node lib/cli/commit.js",
35
35
  "dev": "tsx src/index.ts",
36
- "watch": "tsx watch --include \"src/**/*.ts\" src/index.ts",
37
36
  "fix": "eslint src/**/*.ts --fix",
38
37
  "pr": "node lib/cli/pr.js",
39
38
  "pub": "npm publish --access public",
40
39
  "pub-beta": "npm publish --tag beta",
41
- "sort": "npx sort-package-json"
40
+ "sort": "npx sort-package-json",
41
+ "watch": "tsx watch --include \"src/**/*.ts\" src/index.ts"
42
42
  },
43
43
  "dependencies": {
44
44
  "@ikenxuan/amagi": "^4.4.8",