diff --git a/backend/novasonic-server.js b/backend/novasonic-server.js index 9c1ff12..02c2fa7 100644 --- a/backend/novasonic-server.js +++ b/backend/novasonic-server.js @@ -274,7 +274,10 @@ async function downloadTrack({ jobId, artist, albumArtist, title, album, year, t ); }); - const ytmUrl = `https://music.youtube.com/search?q=${encodeURIComponent(query)}`; + // ¶ms= is YTM's "Songs only" filter (same as clicking "Titel" tab in the browser). + // Without it yt-dlp gets a mixed feed of videos, channels, and playlists as well. + const YTM_SONGS_PARAM = 'EgWKAQIIAWoKEAkQBRAKEAMQBA%3D%3D'; + const ytmUrl = `https://music.youtube.com/search?q=${encodeURIComponent(query)}¶ms=${YTM_SONGS_PARAM}`; // Snapshot files already in dir before we start — so hasAudio() only detects NEW files // from the current download attempt, not pre-existing files from parallel jobs. let snapBefore = new Set(fs.readdirSync(dir));