Skip to content

Instantly share code, notes, and snippets.

@FGRibreau
Created June 24, 2024 20:03
Show Gist options
  • Save FGRibreau/420b5da7289969e5746298356a49423c to your computer and use it in GitHub Desktop.
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
@M1XZG
Copy link

M1XZG commented Feb 11, 2025

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.

@uncocosembrado
Copy link

works great!, thanks

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