mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🎈 pref: 优化阿b直播解析
This commit is contained in:
parent
b9bb9bd934
commit
5b1c59dfab
@ -75,7 +75,7 @@ import {
|
|||||||
downloadImg,
|
downloadImg,
|
||||||
estimateReadingTime,
|
estimateReadingTime,
|
||||||
formatBiliInfo,
|
formatBiliInfo,
|
||||||
retryAxiosReq,
|
retryAxiosReq, saveJsonToFile,
|
||||||
secondsToTime,
|
secondsToTime,
|
||||||
testProxy,
|
testProxy,
|
||||||
truncateString,
|
truncateString,
|
||||||
@ -542,12 +542,17 @@ export class tools extends plugin {
|
|||||||
// logger.info(streamId)
|
// logger.info(streamId)
|
||||||
// 提取相关信息
|
// 提取相关信息
|
||||||
const liveData = await this.getBiliStream(streamId);
|
const liveData = await this.getBiliStream(streamId);
|
||||||
// logger.info(liveData);
|
// saveJsonToFile(liveData.data);
|
||||||
const { title, user_cover, keyframe, description, tags } = liveData.data.data;
|
const { title, user_cover, keyframe, description, tags, live_time, parent_area_name, area_name } = liveData.data.data;
|
||||||
e.reply([
|
e.reply([
|
||||||
segment.image(user_cover),
|
segment.image(user_cover),
|
||||||
segment.image(keyframe),
|
segment.image(keyframe),
|
||||||
`${this.identifyPrefix}识别:哔哩哔哩直播,${title}${description ? `\n\n简述:${description}\n` : ''}${tags ? `标签:${tags}\n` : ''}`
|
[`${ this.identifyPrefix }识别:哔哩哔哩直播,${ title }`,
|
||||||
|
`${ description ? `📝 简述:${ description.replace(`<p>`, '').replace(`</p>`, '') }` : '' }`,
|
||||||
|
`${ tags ? `🔖 标签:${ tags }` : '' }`,
|
||||||
|
`📍 分区:${ parent_area_name ? `${ parent_area_name }` : '' }${ area_name ? `-${ area_name }` : '' }`,
|
||||||
|
`${ live_time ? `⏰ 直播时间:${ live_time }` : '' }`,
|
||||||
|
].filter(item => item.trim() !== "").join("\n")
|
||||||
]);
|
]);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user