3 ms·
OP, it looks like you can just grab the song IDs from their playlist page and then download them from their CDN. If you navigate to a playlist page and run thi
by solardev 2y ago
OP, it looks like you can just grab the song IDs from their playlist page and then download them from their CDN.
If you navigate to a playlist page and run this code in your browser console, it should fetch all the songs:
(async () => {
const songRows = document.querySelectorAll('div[data-testid="song-row"]');
for (const row of songRows) {
const link = row.querySelector('a[href^="/song/"]');
const title = row.querySelector('span[title]').title;
const id = link.href.split('/song/')[1];
const response = await fetch(`https://cdn1.suno.ai/${id}.mp3`);
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${title}.mp3`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
})();