diff --git a/backend/lib/ytdlp.js b/backend/lib/ytdlp.js index 50b817a..ed3894d 100644 --- a/backend/lib/ytdlp.js +++ b/backend/lib/ytdlp.js @@ -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',