soundcloud

package module
v0.0.0-...-9281772 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 6 Imported by: 1

README

go-soundcloud

Single file library for accessing SoundCloud metadata and audio URLs in Golang without extra dependencies

Installing

go get github.com/JoshuaDoes/go-soundcloud

Example

package main

import "fmt"
import "github.com/JoshuaDoes/go-soundcloud"

func main() {
	//Initialize a new client
	c := &soundcloud.Client{ClientID:"your client id here", AppVersion:"your app version here"}

	//Get metadata and an audio URL
	res, err := c.GetTrackInfo("https://soundcloud.com/artist/title")

	if err != nil {
		panic(err)
	}
	
	fmt.Println("Track ID: " + res.Track)
	fmt.Println("Title: " + res.Title)
	fmt.Println("Artist: " + res.Artist)
	fmt.Println("Description: " + res.Description)
	fmt.Println("Download URL: " + res.DownloadURL)
	fmt.Println("Artwork URL: " + res.ArtURL)
}
Output
> go run main.go

< Track ID
< Title
< Artist
< Description
< Download URL
< Artwork URL

License

The source code for go-soundcloud is released under the MIT License. See LICENSE for more details.

Donations

All donations are appreciated and helps me stay awake at night to work on this more. Even if it's not much, it helps a lot in the long run! You can find the donation link here: Donation Link

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientID string
}

func (*Client) GetTrackInfo

func (c *Client) GetTrackInfo(url string) (*Track, error)

type Track

type Track struct {
	Artist      string
	ArtURL      string
	Description string
	DownloadURL string
	Title       string
	Track       string
}

Jump to

Keyboard shortcuts

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