bandcamp

package
v1.37.4 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2021 License: OSL-3.0 Imports: 7 Imported by: 1

README

Bandcamp

Key

Date: Fri, 17 Sep 2021 21:31:29 +0000
From: Bandcamp Support <support@bandcamp.com>
Subject: Re: (Case 1268890) API Access

Thanks for your interest. Our APIs are currently limited to Label Accounts
(bandcamp.com/labels) looking to pull physical order and general sales
information, though that might change down the road. Please keep an eye on
bandcamp.com/developer for updates.

Resolve

For tracks and albums, you can make a request like this:

HEAD /track/amaris-2 HTTP/1.1
Host: schnaussandmunk.bandcamp.com

and in the response should be this:

Set-Cookie: session=1 r:["nilZ0t2809477874x1633448962"]	t:1633448962

In this case, t is the tralbum_type and 2809477874 is the tralbum_id. You can then make a request like this:

GET /api/mobile/24/tralbum_details?band_id=1&tralbum_type=t&tralbum_id=2809477874 HTTP/1.1
Host: bandcamp.com

For bands, you can make a request like this:

HEAD /music HTTP/1.1
Host: schnaussandmunk.bandcamp.com

Documentation

Index

Constants

View Source
const (
	MobileBand    = "http://bandcamp.com/api/mobile/24/band_details"
	MobileTralbum = "http://bandcamp.com/api/mobile/24/tralbum_details"
)

Variables

View Source
var Heights = map[int]int{
	100:  3,
	124:  8,
	135:  15,
	138:  12,
	150:  7,
	172:  11,
	210:  9,
	300:  4,
	350:  2,
	368:  14,
	380:  13,
	700:  5,
	1200: 10,
	1500: 1,
}
View Source
var Verbose = mech.Verbose

Functions

func ArtURL added in v1.35.9

func ArtURL(id, height int) string

Types

type Band added in v1.29.5

type Band struct {
	Artists []struct {
		ID   int
		Name string
	}
	Bandcamp_URL string
	Discography  []Item
}

func NewBand added in v1.33.6

func NewBand(id int) (*Band, error)

ID to Band. Request is anonymous.

type Item added in v1.35.1

type Item struct {
	Item_Type string
	Item_ID   int
}

func NewItem added in v1.35.2

func NewItem(addr string) (*Item, error)

URL to Item. Request is anonymous.

func (Item) Tralbum added in v1.35.1

func (i Item) Tralbum() (*Tralbum, error)

type Tralbum added in v1.33.3

type Tralbum struct {
	Art_ID       int
	Release_Date int64
	Title        string
	Tracks       []struct {
		Streaming_URL struct {
			MP3_128 string `json:"mp3-128"`
		}
	}
	Tralbum_Artist string
}

All fields available with Track and Album

func NewTralbum added in v1.33.4

func NewTralbum(typ byte, id int) (*Tralbum, error)

ID to Tralbum. Request is anonymous.

func (Tralbum) Unix added in v1.33.4

func (t Tralbum) Unix() time.Time

Jump to

Keyboard shortcuts

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