After migrating from Spotify to YouTube Music, I had the issue that my "liked songs" became a playlist on YouTube Music, instead of "liked songs".
I automatically added this entire playlist to likes song using the following steps.
- Open YouTube Music in your browser.
- Open the playlist you want to like.
- Scroll to the very bottom so all songs load.
- Press F12 to open Developer Tools → go to the Console tab.
- Paste the script below → hit Enter.
Note that this script starts from the bottom up, because that was the chronological order of my playlist.
Note that it might catch some unwanted "likes" at the bottom and the top, due to recommendations using the same labels. Either remove these manually from the page before running the script, or remove them from liked songs after running the script.
async function likeAllSongsBottomUp() {
const delay = ms => new Promise(res => setTimeout(res, ms));
// Fetch all unliked buttons
let buttons = Array.from(
document.querySelectorAll(
'ytmusic-like-button-renderer[like-status="INDIFFERENT"] button[aria-label="Like"][aria-pressed="false"]'
)
);
console.log("Found", buttons.length, "songs to like.");
// Reverse order so we start at the bottom
buttons.reverse();
for (let i = 0; i < buttons.length; i++) {
const btn = buttons[i];
btn.click();
console.log(`Liked ${i + 1}/${buttons.length}`);
await delay(500); // You can increase this if YTM begins to miss clicks
}
console.log("Done (bottom → top)!");
}
likeAllSongsBottomUp();