A simple command-line & library downloader for SoundCloud tracks written in Go.
go install github.com/hellsontime/scdl/cmd/scdl@latestgo build -o scdl cmd/scdl/main.goor
make build-os-archOr download latest release build
scdl <soundcloud-url> [options]-o, --output: Specify the output directory (defaults to current directory).-a, --author: Override artist/author name.-n, --name: Override track title.
Download to the current directory:
scdl https://soundcloud.com/cowboyclicker/stayDownload to a specific directory:
scdl https://soundcloud.com/cowboyclicker/stay --output ~/Music/Download with custom artist and track name:
scdl https://soundcloud.com/cowboyclicker/stay --author "Custom Artist" --name "Custom Title"go get github.com/hellsontime/scdlimport (
"context"
"github.com/hellsontime/scdl"
)
// ...
ctx := context.Background()
client, err := scdl.NewClient(ctx)
if err != nil {
return err
}
// Fetch track metadata
track, err := client.GetTrack(ctx, "https://soundcloud.com/cowboyclicker/stay")
if err != nil {
return err
}
// Optionally override artist/title before downloading
track.Artist = "Custom Artist"
track.Title = "Custom Title"
// Download the track to the current directory
path, err := client.Download(ctx, track, ".", nil) // progress callback is optional
if err != nil {
return err
}