soundcloud

package
v1.25.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2021 License: OSL-3.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const Origin = "https://api-v2.soundcloud.com"

Variables

This section is empty.

Functions

func ReadClientID added in v1.25.2

func ReadClientID() (string, error)

func WriteClientID added in v1.25.2

func WriteClientID() error

client_id appears to last for at least a year

Types

type Media

type Media struct {
	URL string
}

MediaURLResponse is the JSON response of retrieving media information of a track

type Track

type Track struct {
	// Media contains an array of transcoding for a track
	Media struct {
		// Transcoding contains information about the transcoding of a track
		Transcodings []struct {
			// TranscodingFormat contains the protocol by which the track is
			// delivered ("progressive" or "HLS"), and the mime type of the track
			Format struct {
				Protocol string
			}
			URL string
		}
	}
}

Track represents the JSON response of a track's info

func NewTrack added in v1.25.1

func NewTrack(id, addr string) (*Track, error)

func (Track) GetMedia added in v1.25.1

func (t Track) GetMedia(id string) (*Media, error)

The media URL is the actual link to the audio file for the track. "addr" is Track.Media.Transcodings[0].URL

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL