soundcloud

package
v1.35.5 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: OSL-3.0 Imports: 4 Imported by: 2

README

SoundCloud

artworks:

https://soundcloud.com/oembed?format=json&url=https://soundcloud.com/western_vinyl/jessica-risker-cut-my-hair
https://i1.sndcdn.com/artworks-000308141235-7ep8lo-t500x500.jpg

placeholder:

https://soundcloud.com/oembed?format=json&url=https://soundcloud.com/pdis_inpartmaint/harold-budd-perhaps-moss
https://soundcloud.com/images/fb_placeholder.png

avatars:

https://soundcloud.com/oembed?format=json&url=https://soundcloud.com/pdis_inpartmaint
https://i1.sndcdn.com/avatars-000274827119-0dxutu-t500x500.jpg

How to get client_id

First, make a request like this:

GET / HTTP/2
Host: m.soundcloud.com

In the HTML response, you should see something like this:

"clientId":"iZIs9mchVcX5lhVRyQGGAYlNPVldzAoX"

The client_id seems to last at least a year:

https://github.com/rrosajp/soundcloud-archive/commit/c02809dc

Documentation

Index

Constants

View Source
const (
	Origin      = "https://api-v2.soundcloud.com"
	Placeholder = "https://soundcloud.com/images/fb_placeholder.png"
)

Variables

View Source
var Verbose = mech.Verbose

Functions

This section is empty.

Types

type Alternate added in v1.27.2

type Alternate struct {
	Thumbnail_URL string
	Author_URL    string
}

func Oembed added in v1.26.9

func Oembed(addr string) (*Alternate, error)

type Media

type Media struct {
	// cf-media.sndcdn.com/QaV7QR1lxpc6.128.mp3?Policy=eyJTdGF0ZW1lbnQiOlt7IlJl...
	URL string
}

type Track

type Track struct {
	ID           int
	Title        string
	Display_Date string
	Media        struct {
		Transcodings []struct {
			Format struct {
				Protocol string
			}
			// api-v2.soundcloud.com/media/soundcloud:tracks:103650107/
			// aca81dd5-2feb-4fc4-a102-036fb35fe44a/stream/progressive
			URL string
		}
	}
	User struct {
		Username string
	}
}

func Resolve added in v1.26.8

func Resolve(addr string) (*Track, error)

func Tracks added in v1.26.8

func Tracks(ids string) ([]Track, error)

func (Track) GetMedia added in v1.25.1

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

Jump to

Keyboard shortcuts

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