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)
iferr!=nil {
returnerr
}
// Fetch track metadatatrack, err:=client.GetTrack(ctx, "https://soundcloud.com/cowboyclicker/stay")
iferr!=nil {
returnerr
}
// Optionally override artist/title before downloadingtrack.Artist="Custom Artist"track.Title="Custom Title"// Download the track to the current directorypath, err:=client.Download(ctx, track, ".", nil) // progress callback is optionaliferr!=nil {
returnerr
}