Skip to content

Instantly share code, notes, and snippets.

@FGRibreau
Created June 24, 2024 20:03
Show Gist options
  • Select an option

  • Save FGRibreau/420b5da7289969e5746298356a49423c to your computer and use it in GitHub Desktop.

Select an option

Save FGRibreau/420b5da7289969e5746298356a49423c to your computer and use it in GitHub Desktop.
Download all Suno (app.suno.ai) songs displayed on a page
// open your javascript console and paste this
copy([...$('[role="grid"]')[Object.keys($('[role="grid"]')).filter(x => x.startsWith('__reactProps'))[0]].children[0].props.values[0][1].collection].filter(x => x.value.audio_url).map(x => x.value.audio_url).join(' '))
// now you have a list of mp3 urls directly in your clipboard that you can pass to wget or a url downloader
@gadelkareem
Copy link

Anyone managed to automate downloading the wav files?

@RubinOrlando
Copy link

After getting a series of error messages, I modified the script so that it worked for me (pardon my Dutch comments):

// Pak het eerste grid element
let grid = $$("div[role=grid]")[0];

// Zoek de dynamische React props key (__reactProps$...)
let key = Object.keys(grid).find(k => k.startsWith("__reactProps$"));

// Haal de props op
let props = grid[key];

// Pak het eerste child object
let firstChild = props.children[0];

// Haal de values array
let values = firstChild.props.values;

// Pak de collection uit het eerste sub-array
let collection = values[0][1].collection;

// Zet de collection om naar een array en filter audio_url
let urls = Array.from(collection).map(item => item.value?.audio_url).filter(Boolean);

console.log(urls);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment