fix: use original artist name in YTM search and add strict channel filter

Use mainArtist (with special chars) for ytsearch queries so e.g. "N!GHT - Yume"
searches correctly instead of "NGHT - Yume" which YouTube misreads as "night"
and returns ambience videos.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Sonnet 4.6 committed 2026-05-03 11:50:19 +02:00
1 parent 03fb45b986
commit e858b02df7
1 file changed
+4 -2
+4 -2
View File
@@ -64,8 +64,10 @@ async function downloadTrack({ jobId, artist, albumArtist, title, album, year, t
}
const outputTemplate = path.join(dir, `${trackPrefix}${safeTitle}.%(ext)s`);
const searchArtist = mainArtist.replace(/[^\p{L}\p{N}\s,&\-]/gu, '').trim();
const query = `${searchArtist} - ${title}`;
// Use original artist name (with special chars) for all searches — stripping e.g. "N!GHT" → "NGHT"
// causes ytsearch to match "night" ambience videos instead of the artist.
// spawn() passes args directly without shell interpretation so special chars are safe.
const query = `${mainArtist} - ${title}`;
const baseArgs = [
'--extract-audio',