Documentation
¶
Index ¶
- Constants
- Variables
- func ContextTrackToProvidedTrack(typ SpotifyIdType, track *connectpb.ContextTrack) *connectpb.ProvidedTrack
- func ContextUriType(uri string) string
- func GetCpuFamily() spotifypb.CpuFamily
- func GetOS() spotifypb.Os
- func GetPlatform() spotifypb.Platform
- func GetPlatformSpecificData() *clienttokenpb.PlatformSpecificData
- func GidToBase62(id []byte) string
- func ObfuscateUsername(username string) string
- func SpotifyLikeClientVersion() string
- func SystemInfoString() string
- func UserAgent() string
- func VersionNumberString() string
- func VersionString() string
- type AppState
- type AudioSource
- type Float32Reader
- type GetAddressFunc
- type GetLogin5TokenFunc
- type Logger
- type Media
- func (te Media) Duration() int32
- func (te Media) Episode() *metadatapb.Episode
- func (te Media) Id() SpotifyId
- func (te Media) IsEpisode() bool
- func (te Media) IsTrack() bool
- func (te Media) Name() string
- func (te Media) Restriction() []*metadatapb.Restriction
- func (te Media) Track() *metadatapb.Track
- type NullLogger
- func (l *NullLogger) Debug(...interface{})
- func (l *NullLogger) Debugf(string, ...interface{})
- func (l *NullLogger) Error(...interface{})
- func (l *NullLogger) Errorf(string, ...interface{})
- func (l *NullLogger) Info(...interface{})
- func (l *NullLogger) Infof(string, ...interface{})
- func (l *NullLogger) Trace(...interface{})
- func (l *NullLogger) Tracef(string, ...interface{})
- func (l *NullLogger) Warn(...interface{})
- func (l *NullLogger) Warnf(string, ...interface{})
- func (l *NullLogger) WithError(error) Logger
- func (l *NullLogger) WithField(string, interface{}) Logger
- type PageResolver
- type SizedReadAtSeeker
- type SpotifyId
- type SpotifyIdType
- type StateStore
Constants ¶
const SpotifyVersionCode = 127700358
Variables ¶
var ( ErrMediaRestricted = errors.New("media is restricted") ErrNoSupportedFormats = errors.New("no supported formats") )
var ClientId = []byte{0x65, 0xb7, 0x8, 0x7, 0x3f, 0xc0, 0x48, 0xe, 0xa9, 0x2a, 0x7, 0x72, 0x33, 0xca, 0x87, 0xbd}
var ClientIdHex = hex.EncodeToString(ClientId)
var UriRegexp = regexp.MustCompile("^spotify:([a-z]+):([0-9a-zA-Z]{21,22})$")
Functions ¶
func ContextTrackToProvidedTrack ¶
func ContextTrackToProvidedTrack(typ SpotifyIdType, track *connectpb.ContextTrack) *connectpb.ProvidedTrack
func ContextUriType ¶ added in v0.9.0
ContextUriType extracts the type segment of a context URI, that is the "album" of "spotify:album:xxx". User scoped URIs such as "spotify:user:someone:playlist:xxx" carry the username in that position, so for those the segment after it is the meaningful one.
The type is the last segment for a user scoped context that needs no id of its own — Liked Songs is "spotify:user:someone:collection" — so four segments are enough, not five.
func GetCpuFamily ¶
func GetPlatform ¶
func GetPlatformSpecificData ¶
func GetPlatformSpecificData() *clienttokenpb.PlatformSpecificData
func GidToBase62 ¶
func ObfuscateUsername ¶ added in v0.3.0
func SpotifyLikeClientVersion ¶
func SpotifyLikeClientVersion() string
func SystemInfoString ¶
func SystemInfoString() string
func VersionNumberString ¶
func VersionNumberString() string
func VersionString ¶
func VersionString() string
Types ¶
type AudioSource ¶
type Float32Reader ¶
type GetAddressFunc ¶
GetAddressFunc is a function that everytime it is called returns a different address for that type of endpoint.
type GetLogin5TokenFunc ¶
GetLogin5TokenFunc is a function that everytime it is called returns a valid login5 access token.
type Logger ¶ added in v0.2.0
type Logger interface {
Tracef(format string, args ...interface{})
Debugf(format string, args ...interface{})
Infof(format string, args ...interface{})
Warnf(format string, args ...interface{})
Errorf(format string, args ...interface{})
Trace(args ...interface{})
Debug(args ...interface{})
Info(args ...interface{})
Warn(args ...interface{})
Error(args ...interface{})
WithField(key string, value interface{}) Logger
WithError(err error) Logger
}
type Media ¶
type Media struct {
// contains filtered or unexported fields
}
func NewMediaFromEpisode ¶
func NewMediaFromEpisode(episode *metadatapb.Episode) *Media
func NewMediaFromTrack ¶
func NewMediaFromTrack(track *metadatapb.Track) *Media
func (Media) Episode ¶
func (te Media) Episode() *metadatapb.Episode
func (Media) Restriction ¶
func (te Media) Restriction() []*metadatapb.Restriction
func (Media) Track ¶
func (te Media) Track() *metadatapb.Track
type NullLogger ¶ added in v0.5.0
type NullLogger struct{}
func (*NullLogger) Debug ¶ added in v0.5.0
func (l *NullLogger) Debug(...interface{})
func (*NullLogger) Debugf ¶ added in v0.5.0
func (l *NullLogger) Debugf(string, ...interface{})
func (*NullLogger) Error ¶ added in v0.5.0
func (l *NullLogger) Error(...interface{})
func (*NullLogger) Errorf ¶ added in v0.5.0
func (l *NullLogger) Errorf(string, ...interface{})
func (*NullLogger) Info ¶ added in v0.5.0
func (l *NullLogger) Info(...interface{})
func (*NullLogger) Infof ¶ added in v0.5.0
func (l *NullLogger) Infof(string, ...interface{})
func (*NullLogger) Trace ¶ added in v0.5.0
func (l *NullLogger) Trace(...interface{})
func (*NullLogger) Tracef ¶ added in v0.5.0
func (l *NullLogger) Tracef(string, ...interface{})
func (*NullLogger) Warn ¶ added in v0.5.0
func (l *NullLogger) Warn(...interface{})
func (*NullLogger) Warnf ¶ added in v0.5.0
func (l *NullLogger) Warnf(string, ...interface{})
func (*NullLogger) WithError ¶ added in v0.5.0
func (l *NullLogger) WithError(error) Logger
func (*NullLogger) WithField ¶ added in v0.5.0
func (l *NullLogger) WithField(string, interface{}) Logger
type PageResolver ¶
type SizedReadAtSeeker ¶
type SizedReadAtSeeker interface {
io.ReadSeeker
io.ReaderAt
Size() int64
}
type SpotifyId ¶
type SpotifyId struct {
// contains filtered or unexported fields
}
func SpotifyIdFromBase62 ¶ added in v0.1.3
func SpotifyIdFromBase62(typ SpotifyIdType, id string) (*SpotifyId, error)
func SpotifyIdFromGid ¶
func SpotifyIdFromGid(typ SpotifyIdType, id []byte) SpotifyId
func SpotifyIdFromUri ¶
func (SpotifyId) Type ¶
func (id SpotifyId) Type() SpotifyIdType
type SpotifyIdType ¶
type SpotifyIdType string
const ( SpotifyIdTypeTrack SpotifyIdType = "track" SpotifyIdTypeEpisode SpotifyIdType = "episode" SpotifyIdTypePlaylist SpotifyIdType = "playlist" SpotifyIdTypeAlbum SpotifyIdType = "album" SpotifyIdTypeArtist SpotifyIdType = "artist" SpotifyIdTypeShow SpotifyIdType = "show" SpotifyIdTypeUnknown SpotifyIdType = "" )
func InferSpotifyIdTypeFromContextUri ¶
func InferSpotifyIdTypeFromContextUri(uri string) SpotifyIdType
InferSpotifyIdTypeFromContextUri returns the type of the *items* a context holds. A ContextTrack often carries only a gid, and a gid does not say what it identifies, so the context is what decides how to turn it back into a URI.
Anything unrecognised returns SpotifyIdTypeUnknown instead of being assumed to be a track.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cache implements an on-disk cache for the encrypted audio files downloaded from the Spotify CDN.
|
Package cache implements an on-disk cache for the encrypted audio files downloaded from the Spotify CDN. |
|
cmd
|
|
|
daemon
command
|
|
|
Package daemon provides primitives to interact with the openapi HTTP API.
|
Package daemon provides primitives to interact with the openapi HTTP API. |
|
proto
|
|