utils

package
v0.0.0-...-377997a Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APResolve

func APResolve() (string, error)

APResolve fetches the available Spotify servers (AP) and picks a random one

func Base62ToHex

func Base62ToHex(b62 string) string

func Convert62

func Convert62(id string) []byte

func ConvertTo62

func ConvertTo62(raw []byte) string

func GenerateDeviceId

func GenerateDeviceId(name string) string

Types

type APList

type APList struct {
	ApList []string `json:"ap_list"`
}

APList is the JSON structure corresponding to the output of the AP endpoint resolve API

type BlobInfo

type BlobInfo struct {
	Username    string
	DecodedBlob string
}

BlobInfo is the structure holding authentication blob data. The blob is an encoded/encrypted byte array (encoded as base64), holding the encryption keys, the deviceId, and the username.

func BlobFromFile

func BlobFromFile(path string) (BlobInfo, error)

BlobFromFile restores a Blob from the specified path

func NewBlobInfo

func NewBlobInfo(blob64 string, client64 string,
	keys crypto.PrivateKeys, deviceId string, username string) (BlobInfo, error)

NewBlobInfo creates a new BlobInfo structure with the blob data filled in DecodedBlob field

func (*BlobInfo) MakeAuthBlob

func (b *BlobInfo) MakeAuthBlob(deviceId string, client64 string, dhKeys crypto.PrivateKeys) (string, error)

MakeAuthBlob builds an encoded blob in order to authenticate against Spotify services

func (*BlobInfo) SaveToFile

func (b *BlobInfo) SaveToFile(path string) error

SaveToFile saves the current blob to the specified path

Jump to

Keyboard shortcuts

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