-
-
Save FGRibreau/420b5da7289969e5746298356a49423c to your computer and use it in GitHub Desktop.
| // 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 |
If you want a slightly improved download script that @jagamypriera created, this one will let you specify any input file you like but it also handles duplicate filenames by appending a number to the song name.
example:
Stardust Reverberation.mp3
Stardust Reverberation.mp4
Stardust Reverberation_2.mp3
Stardust Reverberation_2.mp4
#!/bin/bash
# Check if the input file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <input_file>"
exit 1
fi
input_file="$1"
# Read the file line by line
while IFS="|" read -r filename url; do
# Check if the file already exists
if [[ -e "$filename" ]]; then
base="${filename%.*}"
ext="${filename##*.}"
counter=2
while [[ -e "${base}_${counter}.${ext}" ]]; do
((counter++))
done
filename="${base}_${counter}.${ext}"
fi
# Print the song name being downloaded
echo "Downloading $filename"
# Use curl to download the file
curl -o "$filename" "$url"
# Wait for 1 second
sleep 1
done < "$input_file"
I hope this helps someone.
works great!, thanks
Im trying to do this but the issue is when pasting it in the console window it doesnt work. I looked and it seems the children element doesnt exsist.
if you want to do this from a playlist, can use
copy([...$('[role="grid"]')[Object.keys($('[role="grid"]')).filter(x => x.startsWith('__reactProps'))[0]].children[0].props.values[0][1].collection].filter(x => x.value.clip.clip.audio_url).map(x => x.value.clip.clip.audio_url).join(' '))
Would you have a JS code working as of July 2025?
Something that you can copy/pate in console when you are on https://suno.com/create?wid=default&page=2
@william-r-s @FGRibreau The previous code doesn't work anymore.
Would you have a JS code working as of July 2025?
Something that you can copy/pate in console when you are on https://suno.com/create?wid=default&page=2
@william-r-s @FGRibreau The previous code doesn't work anymore.
I've created a small Python script that removes the need for using the Javascript console, based on the original code of @FGRibreau . You can get it here: https://gist.github.com/dppancake/f9f43825209050b27900347014459fa4
Let me know if it works
Anyone managed to automate downloading the wav files?
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);
I'd like to offer an updated js snippet to the work done by @gadelkareem , this one will handle the renaming of multiple song names. Don't we all just love how SUNO always spends double our credits making 2 songs fo every prompt.
I found the original code above was a bit problematic because it would try to name the songs the same which doesn't work well when bulk downloading.
This code will give multiple songs of the same name a number such as
songname_2,songname_3etc. The first song name is untouched.Example:
I hope this helps.