更新歌词匹配

This commit is contained in:
zyc404 2024-05-09 22:30:23 +08:00
parent 7288e2b845
commit adcbcf1f40

View file

@ -316,7 +316,8 @@ export default class BingSunoClient {
fs.unlinkSync(videoPath) fs.unlinkSync(videoPath)
}, 60000) }, 60000)
} else { } else {
logger.warn(`${song.title}下载视频失败,仅发送视频链接`) logger.warn(`${song.title}下载视频失败`)
await this.reply(`${song.title}下载视频失败`)
} }
} }
@ -623,7 +624,7 @@ export default class BingSunoClient {
lines.forEach(line => { lines.forEach(line => {
// 检查每一行是否包含分段关键词 // 检查每一行是否包含分段关键词
const sectionFound = sectionKeywords.some(keyword => { const sectionFound = sectionKeywords.some(keyword => {
const regex = new RegExp(`\\[${keyword} \\d+\\]|\\(${keyword} \\d+\\)`, 'i') const regex = new RegExp(`\\[${keyword} \\d+\\]|\\(${keyword} \\d+\\)|\\*\\*${keyword} \\d+\\*\\*`, 'i')
return regex.test(line) return regex.test(line)
}) })
// 如果找到第一个分段关键词,开始提取歌词 // 如果找到第一个分段关键词,开始提取歌词