karin-plugin-kkk 1.0.6 → 1.0.8-pr32.b8da68c
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 +8 -0
- package/README.md +7 -9
- package/lib/apps/admin.js +17 -18
- package/lib/cli/pr.js +1 -1
- package/lib/module/utils/Networks.d.ts +1 -1
- package/lib/module/utils/Networks.js +10 -9
- package/lib/platform/douyin/douyin.d.ts +2 -1
- package/lib/platform/douyin/douyin.js +99 -96
- package/lib/platform/douyin/getID.js +6 -1
- package/lib/platform/douyin/push.js +1 -1
- package/package.json +2 -11
- package/resources/template/douyin/html/comment.html +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.0.7](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.0.6...v1.0.7) (2025-01-30)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* 抖音推送图集解析 ([0ccc71a](https://github.com/ikenxuan/karin-plugin-kkk/commit/0ccc71a0bdb2e302a00a28bc9bbeeee415af4dba))
|
|
9
|
+
* 移除无用导入 ([3a3aac3](https://github.com/ikenxuan/karin-plugin-kkk/commit/3a3aac37291dae65cad66f0a9fc80850ad95c265))
|
|
10
|
+
|
|
3
11
|
## [1.0.6](https://github.com/ikenxuan/karin-plugin-kkk/compare/v1.0.5...v1.0.6) (2025-01-21)
|
|
4
12
|
|
|
5
13
|
|
package/README.md
CHANGED
|
@@ -88,19 +88,17 @@ git clone https://github.com/你的GitHub用户名/karin-plugin-kkk.git
|
|
|
88
88
|
```sh
|
|
89
89
|
cd karin-plugin-kkk/
|
|
90
90
|
```
|
|
91
|
-
4.
|
|
91
|
+
4. 初始化开发环境
|
|
92
|
+
```sh
|
|
93
|
+
pnpm run init
|
|
94
|
+
```
|
|
95
|
+
5. 安装依赖
|
|
92
96
|
```sh
|
|
93
97
|
pnpm install
|
|
94
98
|
```
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
两条命令任选一条执行
|
|
98
|
-
|
|
99
|
+
6. 启动开发环境
|
|
99
100
|
```sh
|
|
100
|
-
|
|
101
|
-
pnpm ts
|
|
102
|
-
# 保存 src 目录下的文件后自动重启
|
|
103
|
-
pnpm watch
|
|
101
|
+
pnpm dev
|
|
104
102
|
```
|
|
105
103
|
</details>
|
|
106
104
|
|
package/lib/apps/admin.js
CHANGED
|
@@ -36,30 +36,29 @@ export const setbilick = karin.command(/^#?(kkk)?s*设置s*(B站)ck$/i, async (e
|
|
|
36
36
|
await e.reply('设置成功!', { at: true });
|
|
37
37
|
return true;
|
|
38
38
|
}, { perm: 'master', name: 'kkk-ck管理', event: 'message.friend' });
|
|
39
|
-
const authFailMsg = '你暂时没有这个权限使用这个功能啦 ~ 只有主人可以使用哦';
|
|
40
39
|
// 插件类
|
|
41
40
|
export class Admin extends Plugin {
|
|
42
41
|
constructor() {
|
|
43
42
|
super({
|
|
44
43
|
name: 'kkk-管理',
|
|
45
44
|
rule: [
|
|
46
|
-
{ reg: createSwitchRegExp('app'), fnc: 'ConfigSwitch', permission: 'master'
|
|
47
|
-
{ reg: createNumberRegExp('app'), fnc: 'ConfigNumber', permission: 'master'
|
|
48
|
-
{ reg: createCustomRegExp('app'), fnc: 'ConfigCustom', permission: 'master'
|
|
49
|
-
{ reg: createSwitchRegExp('douyin'), fnc: 'ConfigSwitch', permission: 'master'
|
|
50
|
-
{ reg: createNumberRegExp('douyin'), fnc: 'ConfigNumber', permission: 'master'
|
|
51
|
-
{ reg: createNumberRegExp('douyin'), fnc: 'ConfigCustom', permission: 'master'
|
|
52
|
-
{ reg: createSwitchRegExp('bilibili'), fnc: 'ConfigSwitch', permission: 'master'
|
|
53
|
-
{ reg: createNumberRegExp('bilibili'), fnc: 'ConfigNumber', permission: 'master'
|
|
54
|
-
{ reg: createNumberRegExp('bilibili'), fnc: 'ConfigCustom', permission: 'master'
|
|
55
|
-
{ reg: createSwitchRegExp('upload'), fnc: 'ConfigSwitch', permission: 'master'
|
|
56
|
-
{ reg: createNumberRegExp('upload'), fnc: 'ConfigNumber', permission: 'master'
|
|
57
|
-
{ reg: createNumberRegExp('upload'), fnc: 'ConfigCustom', permission: 'master'
|
|
58
|
-
{ reg: createSwitchRegExp('kuaishou'), fnc: 'ConfigSwitch', permission: 'master'
|
|
59
|
-
{ reg: createNumberRegExp('kuaishou'), fnc: 'ConfigNumber', permission: 'master'
|
|
60
|
-
{ reg: createNumberRegExp('kuaishou'), fnc: 'ConfigCustom', permission: 'master'
|
|
61
|
-
{ reg: /^#kkk设置$/, fnc: 'index_Settings', permission: 'master'
|
|
62
|
-
{ reg: /^#?kkk删除缓存$/, fnc: 'deleteCache', permission: 'master'
|
|
45
|
+
{ reg: createSwitchRegExp('app'), fnc: 'ConfigSwitch', permission: 'master' },
|
|
46
|
+
{ reg: createNumberRegExp('app'), fnc: 'ConfigNumber', permission: 'master' },
|
|
47
|
+
{ reg: createCustomRegExp('app'), fnc: 'ConfigCustom', permission: 'master' },
|
|
48
|
+
{ reg: createSwitchRegExp('douyin'), fnc: 'ConfigSwitch', permission: 'master' },
|
|
49
|
+
{ reg: createNumberRegExp('douyin'), fnc: 'ConfigNumber', permission: 'master' },
|
|
50
|
+
{ reg: createNumberRegExp('douyin'), fnc: 'ConfigCustom', permission: 'master' },
|
|
51
|
+
{ reg: createSwitchRegExp('bilibili'), fnc: 'ConfigSwitch', permission: 'master' },
|
|
52
|
+
{ reg: createNumberRegExp('bilibili'), fnc: 'ConfigNumber', permission: 'master' },
|
|
53
|
+
{ reg: createNumberRegExp('bilibili'), fnc: 'ConfigCustom', permission: 'master' },
|
|
54
|
+
{ reg: createSwitchRegExp('upload'), fnc: 'ConfigSwitch', permission: 'master' },
|
|
55
|
+
{ reg: createNumberRegExp('upload'), fnc: 'ConfigNumber', permission: 'master' },
|
|
56
|
+
{ reg: createNumberRegExp('upload'), fnc: 'ConfigCustom', permission: 'master' },
|
|
57
|
+
{ reg: createSwitchRegExp('kuaishou'), fnc: 'ConfigSwitch', permission: 'master' },
|
|
58
|
+
{ reg: createNumberRegExp('kuaishou'), fnc: 'ConfigNumber', permission: 'master' },
|
|
59
|
+
{ reg: createNumberRegExp('kuaishou'), fnc: 'ConfigCustom', permission: 'master' },
|
|
60
|
+
{ reg: /^#kkk设置$/, fnc: 'index_Settings', permission: 'master' },
|
|
61
|
+
{ reg: /^#?kkk删除缓存$/, fnc: 'deleteCache', permission: 'master' }
|
|
63
62
|
]
|
|
64
63
|
});
|
|
65
64
|
}
|
package/lib/cli/pr.js
CHANGED
|
@@ -22,7 +22,7 @@ const updateVersion = (pkg) => {
|
|
|
22
22
|
const list = pkg.version.split('.');
|
|
23
23
|
const shortHash = process.env.GITHUB_SHA?.substring(0, 7) ?? 'unknown';
|
|
24
24
|
list[2] = `${Number(list[2]) + 1}`;
|
|
25
|
-
pkg.version = `${list.join('.')}
|
|
25
|
+
pkg.version = `${list.join('.')}-pr${process.env.PR_NUMBER}.${shortHash}`;
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
28
|
* @description 设置环境变量
|
|
@@ -29,7 +29,7 @@ export declare class Networks {
|
|
|
29
29
|
getfetch(): Promise<AxiosResponse | boolean>;
|
|
30
30
|
returnResult(): Promise<AxiosResponse>;
|
|
31
31
|
/** 最终地址(跟随重定向) */
|
|
32
|
-
getLongLink(): Promise<string>;
|
|
32
|
+
getLongLink(url?: string): Promise<string>;
|
|
33
33
|
/** 获取首个302链接 */
|
|
34
34
|
getLocation(): Promise<AxiosResponse['headers']['location']>;
|
|
35
35
|
/** 获取数据并处理数据的格式化,默认json */
|
|
@@ -156,19 +156,20 @@ export class Networks {
|
|
|
156
156
|
return response;
|
|
157
157
|
}
|
|
158
158
|
/** 最终地址(跟随重定向) */
|
|
159
|
-
async getLongLink() {
|
|
159
|
+
async getLongLink(url = '') {
|
|
160
160
|
try {
|
|
161
|
-
const response = await this.axiosInstance(
|
|
162
|
-
|
|
163
|
-
url: this.url
|
|
164
|
-
});
|
|
165
|
-
return response.request.res.responseUrl; // axios中获取最终的请求URL
|
|
161
|
+
const response = await this.axiosInstance.get(this.url || url);
|
|
162
|
+
return response.request.res.responseUrl;
|
|
166
163
|
}
|
|
167
164
|
catch (error) {
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
const axiosError = error;
|
|
166
|
+
if (axiosError.response && axiosError.response.status === 302) {
|
|
167
|
+
// 获取重定向地址
|
|
168
|
+
const redirectUrl = axiosError.response.headers.location;
|
|
169
|
+
// 递归调用,直到获取最终地址
|
|
170
|
+
return this.getLongLink(redirectUrl);
|
|
170
171
|
}
|
|
171
|
-
|
|
172
|
+
throw error;
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
/** 获取首个302链接 */
|
|
@@ -26,7 +26,8 @@ export type dyVideo = {
|
|
|
26
26
|
export declare class DouYin extends Base {
|
|
27
27
|
e: Message;
|
|
28
28
|
type: DouyinDataTypes[keyof DouyinDataTypes];
|
|
29
|
-
is_mp4:
|
|
29
|
+
is_mp4: boolean | undefined;
|
|
30
|
+
is_slides: boolean;
|
|
30
31
|
get botadapter(): string;
|
|
31
32
|
constructor(e: Message, iddata: ExtendedDouyinOptionsType);
|
|
32
33
|
RESOURCES(data: any): Promise<true | undefined>;
|
|
@@ -11,6 +11,7 @@ export class DouYin extends Base {
|
|
|
11
11
|
e;
|
|
12
12
|
type;
|
|
13
13
|
is_mp4;
|
|
14
|
+
is_slides;
|
|
14
15
|
get botadapter() {
|
|
15
16
|
return this.e.bot?.adapter?.name;
|
|
16
17
|
}
|
|
@@ -19,47 +20,118 @@ export class DouYin extends Base {
|
|
|
19
20
|
this.e = e;
|
|
20
21
|
this.type = iddata?.type;
|
|
21
22
|
this.is_mp4 = iddata?.is_mp4;
|
|
23
|
+
this.is_slides = false;
|
|
22
24
|
}
|
|
23
25
|
async RESOURCES(data) {
|
|
24
26
|
switch (this.type) {
|
|
25
27
|
case 'one_work': {
|
|
26
28
|
if (Config.douyin.tip)
|
|
27
29
|
this.e.reply('检测到抖音链接,开始解析');
|
|
30
|
+
this.is_slides = data.VideoData.aweme_detail.is_slides === true;
|
|
28
31
|
let g_video_url = '';
|
|
29
32
|
let g_title;
|
|
30
|
-
const full_data = [];
|
|
31
33
|
/** 图集 */
|
|
32
34
|
let imagenum = 0;
|
|
33
35
|
const image_res = [];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
image_url
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
switch (true) {
|
|
37
|
+
// 图集
|
|
38
|
+
case this.is_slides === false: {
|
|
39
|
+
const image_data = [];
|
|
40
|
+
const imageres = [];
|
|
41
|
+
let image_url;
|
|
42
|
+
for (let i = 0; i < data.VideoData.aweme_detail.images.length; i++) {
|
|
43
|
+
image_url = data.VideoData.aweme_detail.images[i].url_list[2] || data.VideoData.aweme_detail.images[i].url_list[1]; // 图片地址
|
|
44
|
+
const title = data.VideoData.aweme_detail.preview_title.substring(0, 50).replace(/[\\/:\*\?"<>\|\r\n]/g, ' '); // 标题,去除特殊字符
|
|
45
|
+
g_title = title;
|
|
46
|
+
imageres.push(segment.image(image_url));
|
|
47
|
+
imagenum++;
|
|
48
|
+
if (Config.app.rmmp4 === false) {
|
|
49
|
+
mkdirSync(`${Common.tempDri.images}${g_title}`);
|
|
50
|
+
const path = `${Common.tempDri.images}${g_title}/${i + 1}.png`;
|
|
51
|
+
await new Networks({ url: image_url, type: 'arraybuffer' }).getData().then((data) => fs.promises.writeFile(path, Buffer.from(data)));
|
|
52
|
+
}
|
|
48
53
|
}
|
|
54
|
+
const res = common.makeForward(imageres, this.e.sender.userId, this.e.sender.nick);
|
|
55
|
+
image_data.push(res);
|
|
56
|
+
image_res.push(image_data);
|
|
57
|
+
if (imageres.length === 1) {
|
|
58
|
+
await this.e.reply(segment.image(image_url));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
await this.e.bot.sendForwardMsg(this.e.contact, res, {
|
|
62
|
+
source: '图片合集',
|
|
63
|
+
summary: `查看${res.length}张图片消息`,
|
|
64
|
+
prompt: '抖音图集解析结果',
|
|
65
|
+
news: [{ text: '点击查看解析结果' }]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
49
69
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
// 合辑
|
|
71
|
+
case data.VideoData.aweme_detail.is_slides === true: {
|
|
72
|
+
const images = [];
|
|
73
|
+
const temp = [];
|
|
74
|
+
/** BGM */
|
|
75
|
+
const liveimgbgm = await this.DownLoadFile(data.VideoData.aweme_detail.music.play_url.uri, {
|
|
76
|
+
title: `Douyin_tmp_A_${Date.now()}.mp3`,
|
|
77
|
+
headers: this.headers
|
|
78
|
+
});
|
|
79
|
+
temp.push(liveimgbgm);
|
|
80
|
+
for (const item of data.VideoData.aweme_detail.images) {
|
|
81
|
+
imagenum++;
|
|
82
|
+
// 静态图片,clip_type为2
|
|
83
|
+
if (item.clip_type === 2) {
|
|
84
|
+
images.push(segment.image((item.url_list[0])));
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
/** 动图 */
|
|
88
|
+
const liveimg = await this.DownLoadFile(`https://aweme.snssdk.com/aweme/v1/play/?video_id=${item.video.play_addr_h264.uri}&ratio=1080p&line=0`, {
|
|
89
|
+
title: `Douyin_tmp_V_${Date.now()}.mp4`,
|
|
90
|
+
headers: this.headers
|
|
91
|
+
});
|
|
92
|
+
if (liveimg.filepath) {
|
|
93
|
+
const resolvefilepath = Common.tempDri.video + `Douyin_Result_${Date.now()}.mp4`;
|
|
94
|
+
await mergeFile('视频*3 + 音频', {
|
|
95
|
+
path: liveimg.filepath,
|
|
96
|
+
path2: liveimgbgm.filepath,
|
|
97
|
+
resultPath: resolvefilepath,
|
|
98
|
+
callback: async (success, resultPath) => {
|
|
99
|
+
if (success) {
|
|
100
|
+
const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
|
|
101
|
+
fs.renameSync(resultPath, filePath);
|
|
102
|
+
await this.removeFile(liveimg.filepath, true);
|
|
103
|
+
temp.push({ filepath: filePath, totalBytes: 0 });
|
|
104
|
+
images.push(segment.video('file://' + filePath));
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
await this.removeFile(liveimg.filepath, true);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
const Element = common.makeForward(images, this.e.sender.userId, this.e.sender.nick);
|
|
116
|
+
try {
|
|
117
|
+
await this.e.bot.sendForwardMsg(this.e.contact, Element, {
|
|
118
|
+
source: '合辑内容',
|
|
119
|
+
summary: `查看${Element.length}张图片/视频消息`,
|
|
120
|
+
prompt: '抖音合辑解析结果',
|
|
121
|
+
news: [{ text: '点击查看解析结果' }]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
await this.e.reply(JSON.stringify(error, null, 2));
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
for (const item of temp) {
|
|
129
|
+
await this.removeFile(item.filepath, true);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
58
133
|
}
|
|
59
134
|
}
|
|
60
|
-
else {
|
|
61
|
-
image_res.push('图集信息解析失败');
|
|
62
|
-
}
|
|
63
135
|
/** 背景音乐 */
|
|
64
136
|
if (data.VideoData.aweme_detail.music) {
|
|
65
137
|
const music = data.VideoData.aweme_detail.music;
|
|
@@ -118,7 +190,7 @@ export class DouYin extends Base {
|
|
|
118
190
|
const list = await Emoji(EmojiData);
|
|
119
191
|
const commentsArray = await douyinComments(data.CommentsData, list);
|
|
120
192
|
const img = await Render('douyin/comment', {
|
|
121
|
-
Type: this.is_mp4 ? '视频' : '图集',
|
|
193
|
+
Type: this.is_mp4 ? '视频' : this.is_slides ? '合辑' : '图集',
|
|
122
194
|
CommentsData: commentsArray,
|
|
123
195
|
CommentLength: String(commentsArray.jsonArray?.length ? commentsArray.jsonArray.length : 0),
|
|
124
196
|
share_url: this.is_mp4
|
|
@@ -135,75 +207,6 @@ export class DouYin extends Base {
|
|
|
135
207
|
sendvideofile && this.is_mp4 && await this.DownLoadVideo({ video_url: g_video_url, title: { timestampTitle: `tmp_${Date.now()}.mp4`, originTitle: `${g_title}.mp4` } });
|
|
136
208
|
return true;
|
|
137
209
|
}
|
|
138
|
-
case 'user_mix_videos': {
|
|
139
|
-
const emojiData = await getDouyinData('Emoji数据');
|
|
140
|
-
const commentsData = await douyinComments(data.CommentsData, Emoji(emojiData));
|
|
141
|
-
const commentImage = await Render('douyin/comment', {
|
|
142
|
-
Type: '合辑作品',
|
|
143
|
-
CommentsData: commentsData,
|
|
144
|
-
CommentLength: String(commentsData.jsonArray?.length ? commentsData.jsonArray.length : 0),
|
|
145
|
-
share_url: data.LiveImageData.aweme_details[0].share_url,
|
|
146
|
-
VideoSize: '???',
|
|
147
|
-
VideoFPS: '???',
|
|
148
|
-
ImageLength: '???'
|
|
149
|
-
});
|
|
150
|
-
await this.e.reply(commentImage);
|
|
151
|
-
const images = [];
|
|
152
|
-
const temp = [];
|
|
153
|
-
/** BGM */
|
|
154
|
-
const liveimgbgm = await this.DownLoadFile(data.LiveImageData.aweme_details[0].music.play_url.uri, {
|
|
155
|
-
title: `Douyin_tmp_A_${Date.now()}.mp3`,
|
|
156
|
-
headers: this.headers
|
|
157
|
-
});
|
|
158
|
-
temp.push(liveimgbgm);
|
|
159
|
-
for (const item of data.LiveImageData.aweme_details[0].images) {
|
|
160
|
-
// 静态图片,clip_type为2
|
|
161
|
-
if (item.clip_type === 2) {
|
|
162
|
-
images.push(segment.image((item.url_list[0])));
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
/** 动图 */
|
|
166
|
-
const liveimg = await this.DownLoadFile(`https://aweme.snssdk.com/aweme/v1/play/?video_id=${item.video.play_addr_h264.uri}&ratio=1080p&line=0`, {
|
|
167
|
-
title: `Douyin_tmp_V_${Date.now()}.mp4`,
|
|
168
|
-
headers: this.headers
|
|
169
|
-
});
|
|
170
|
-
if (liveimg.filepath) {
|
|
171
|
-
const resolvefilepath = Common.tempDri.video + `Douyin_Result_${Date.now()}.mp4`;
|
|
172
|
-
await mergeFile('视频*3 + 音频', {
|
|
173
|
-
path: liveimg.filepath,
|
|
174
|
-
path2: liveimgbgm.filepath,
|
|
175
|
-
resultPath: resolvefilepath,
|
|
176
|
-
callback: async (success, resultPath) => {
|
|
177
|
-
if (success) {
|
|
178
|
-
const filePath = Common.tempDri.video + `tmp_${Date.now()}.mp4`;
|
|
179
|
-
fs.renameSync(resultPath, filePath);
|
|
180
|
-
await this.removeFile(liveimg.filepath, true);
|
|
181
|
-
temp.push({ filepath: filePath, totalBytes: 0 });
|
|
182
|
-
images.push(segment.video('file://' + filePath));
|
|
183
|
-
return true;
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
await this.removeFile(liveimg.filepath, true);
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
const Element = common.makeForward(images, this.e.sender.userId, this.e.sender.nick);
|
|
194
|
-
try {
|
|
195
|
-
await this.e.bot.sendForwardMsg(this.e.contact, Element);
|
|
196
|
-
}
|
|
197
|
-
catch (error) {
|
|
198
|
-
await this.e.reply(JSON.stringify(error, null, 2));
|
|
199
|
-
}
|
|
200
|
-
finally {
|
|
201
|
-
for (const item of temp) {
|
|
202
|
-
await this.removeFile(item.filepath, true);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
210
|
case 'user_dynamic': {
|
|
208
211
|
const veoarray = [];
|
|
209
212
|
veoarray.unshift('------------------------------ | ---------------------------- |\n');
|
|
@@ -7,7 +7,12 @@ import { Networks } from '../../module/utils/index.js';
|
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
9
|
export async function getDouyinID(url, log = true) {
|
|
10
|
-
const longLink = await new Networks({
|
|
10
|
+
const longLink = await new Networks({
|
|
11
|
+
url,
|
|
12
|
+
headers: {
|
|
13
|
+
'User-Agent': 'Apifox/1.0.0 (https://apifox.com)'
|
|
14
|
+
}
|
|
15
|
+
}).getLongLink();
|
|
11
16
|
let result = {};
|
|
12
17
|
switch (true) {
|
|
13
18
|
case /https:\/\/(?:www\.iesdouyin\.com)\/share\/slides/.test(longLink):
|
|
@@ -130,7 +130,7 @@ export class DouYinpush extends Base {
|
|
|
130
130
|
else if (!iddata.is_mp4 && iddata.type === 'one_work') { // 如果新作品是图集
|
|
131
131
|
const imageres = [];
|
|
132
132
|
let image_url;
|
|
133
|
-
for (const item of Detail_Data.
|
|
133
|
+
for (const item of Detail_Data.images) {
|
|
134
134
|
image_url = item.url_list[2] || item.url_list[1]; // 图片地址
|
|
135
135
|
imageres.push(segment.image(image_url));
|
|
136
136
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karin-plugin-kkk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8-pr32.b8da68c",
|
|
4
4
|
"description": "a Karin video parsing tool",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"karin-plugin",
|
|
@@ -36,18 +36,9 @@
|
|
|
36
36
|
"pub": "npm publish --access public",
|
|
37
37
|
"pub-beta": "npm publish --tag beta",
|
|
38
38
|
"sort": "npx sort-package-json",
|
|
39
|
-
"karin": "karin",
|
|
40
|
-
"app": "karin app",
|
|
41
39
|
"start": "karin start",
|
|
42
|
-
"pm2": "karin pm2",
|
|
43
|
-
"stop": "karin stop",
|
|
44
|
-
"rs": "karin rs",
|
|
45
|
-
"log": "karin log",
|
|
46
|
-
"up": "karin up",
|
|
47
40
|
"init": "karin init",
|
|
48
|
-
"dev": "tsx watch --include \"src/**/*.ts\" src/index.ts"
|
|
49
|
-
"ts": "karin ts",
|
|
50
|
-
"watch": "karin watch"
|
|
41
|
+
"dev": "tsx watch --include \"src/**/*.ts\" src/index.ts"
|
|
51
42
|
},
|
|
52
43
|
"dependencies": {
|
|
53
44
|
"@ikenxuan/amagi": "4.2.5",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
{{if Type == '视频'}}
|
|
13
13
|
<div class="top-info">视频大小:{{VideoSize}}MB</div>
|
|
14
14
|
<div class="top-info">视频帧率:{{VideoFPS}}Hz</div>
|
|
15
|
-
{{else if Type == '图集'}}
|
|
15
|
+
{{else if Type == '图集' || Type == '合辑'}}
|
|
16
16
|
<div class="top-info">图片数量:{{ImageLength}}张</div>
|
|
17
17
|
{{/if}}
|
|
18
18
|
</div>
|