Open your playlist in your browser, scroll all the way to the bottom (Youtube music does not show all at once), open your developer tools, run this in the console:
(async () => {
const buttons = document.querySelectorAll('button.ytSpecButtonShapeNextHost[aria-pressed="false"][aria-label="Like"]');
console.log(`Found ${buttons.length} Like buttons to click`);
for (const btn of buttons) {
btn.click();
await new Promise(r => setTimeout(r, 500));