This commit is contained in:
吴璨
2026-08-04 09:40:15 +08:00
parent 536685e327
commit 839ec8eb2e
8 changed files with 68 additions and 31 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ const fs = require('fs');
const path = require('path');
const { API, DOWNLOAD_DIR } = require('./config');
const { fetchJSON } = require('./network');
const { formatPersonNames } = require('./utils');
async function fetchLyric(songId) {
try {
@@ -47,7 +48,7 @@ function parseCredits(lrcText) {
const match = line.match(/^([^:]{1,12})\s*[:]\s*(.+)$/);
if (!match) continue;
const label = match[1].trim();
const value = match[2].trim().replace(/\s*\/\s*/g, '/');
const value = formatPersonNames(match[2].trim());
if (!value) continue;
for (const [key, pattern] of Object.entries(labels)) {
if (pattern.test(label) && !credits[key]) {