Documentation
¶
Index ¶
- Variables
- func DecodeSecret(cipher string) []byte
- func FetchBundleURL(ctx context.Context) (string, error)
- func FetchServerTime(ctx context.Context) (*int64, error)
- func GenerateTotp(secret []byte, timestamp int64) string
- type AccessTokenResponse
- type AddedAt
- type AlbumOfTrack
- type ArtistItem
- type ArtistItems
- type ArtistProfile
- type Client
- type ClientTokenResponse
- type ContentRating
- type CoverArt
- type GrantedTokenResponse
- type ImageSource
- type PagingInfo
- type Playability
- type PlaylistContentPage
- type PlaylistData
- type PlaylistItem
- type PlaylistResponse
- type PlaylistV2
- type SecretEntry
- type SharingInfo
- type TotpResult
- type TrackData
- type TrackDuration
- type TrackWrapperV2
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultHeaders = http.Header{ "Host": {"open.spotify.com"}, "Connection": {"keep-alive"}, "Upgrade-Insecure-Requests": {"1"}, "User-Agent": {"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:148.0) Gecko/20100101 Firefox/148.0"}, "Accept": {"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"}, "Accept-Encoding": {"gzip, deflate, br, zstd"}, "Accept-Language": {"en-US,en;q=0.9"}, "Priority": {"u=0, i"}, "Sec-Fetch-Dest": {"document"}, "Sec-Fetch-Mode": {"navigate"}, "Sec-Fetch-Site": {"none"}, "Sec-Fetch-User": {"?1"}, http.HeaderOrderKey: { "Host", "Connection", "Upgrade-Insecure-Requests", "User-Agent", "Accept", "Accept-Encoding", "Accept-Language", "Priority", "Sec-Fetch-Dest", "Sec-Fetch-Mode", "Sec-Fetch-Site", "Sec-Fetch-User", }, } )
View Source
var DefaultPlaylist = "https://open.spotify.com/playlist/46zFIvDlqCi1iNdZVTtGAp" // random hyperpop playlist I found LOL
Functions ¶
func DecodeSecret ¶
func GenerateTotp ¶
Types ¶
type AccessTokenResponse ¶
type AlbumOfTrack ¶
type AlbumOfTrack struct {
Name string `json:"name"`
URI string `json:"uri"`
Artists ArtistItems `json:"artists"`
CoverArt CoverArt `json:"coverArt"`
}
type ArtistItem ¶
type ArtistItem struct {
URI string `json:"uri"`
Profile ArtistProfile `json:"profile"`
}
type ArtistItems ¶
type ArtistItems struct {
Items []ArtistItem `json:"items"`
}
type ArtistProfile ¶
type ArtistProfile struct {
Name string `json:"name"`
}
type Client ¶
type Client struct {
AccessTokenResponse AccessTokenResponse
ClientTokenResponse ClientTokenResponse
// contains filtered or unexported fields
}
func (*Client) GetAccessToken ¶
func (c *Client) GetAccessToken() (AccessTokenResponse, error)
func (*Client) GetClientToken ¶
func (c *Client) GetClientToken() (ClientTokenResponse, error)
func (*Client) GetPlaylist ¶
func (c *Client) GetPlaylist(playlistID string) (*PlaylistResponse, error)
type ClientTokenResponse ¶
type ClientTokenResponse struct {
GrantedTokenResponse GrantedTokenResponse `json:"granted_token"`
}
type ContentRating ¶
type ContentRating struct {
Label string `json:"label"`
}
type CoverArt ¶
type CoverArt struct {
Sources []ImageSource `json:"sources"`
}
type GrantedTokenResponse ¶
type GrantedTokenResponse struct {
Token string `json:"token"`
}
type ImageSource ¶
type PagingInfo ¶
type Playability ¶
type PlaylistContentPage ¶
type PlaylistContentPage struct {
Typename string `json:"__typename"`
Items []PlaylistItem `json:"items"`
PagingInfo PagingInfo `json:"pagingInfo"`
TotalCount int `json:"totalCount"`
}
type PlaylistData ¶
type PlaylistData struct {
PlaylistV2 PlaylistV2 `json:"playlistV2"`
}
type PlaylistItem ¶
type PlaylistItem struct {
UID string `json:"uid"`
AddedAt AddedAt `json:"addedAt"`
ItemV2 TrackWrapperV2 `json:"itemV2"`
}
type PlaylistResponse ¶
type PlaylistResponse struct {
Data PlaylistData `json:"data"`
}
func (*PlaylistResponse) Tracks ¶
func (p *PlaylistResponse) Tracks() []TrackData
type PlaylistV2 ¶
type PlaylistV2 struct {
Typename string `json:"__typename"`
Name string `json:"name"`
Description string `json:"description"`
URI string `json:"uri"`
Followers int `json:"followers"`
Content PlaylistContentPage `json:"content"`
SharingInfo SharingInfo `json:"sharingInfo"`
}
type SecretEntry ¶
func FetchSecrets ¶
func FetchSecrets(ctx context.Context, bundleURL string) ([]SecretEntry, error)
func PickActiveSecret ¶
func PickActiveSecret(secrets []SecretEntry, version int) (SecretEntry, error)
type SharingInfo ¶
type SharingInfo struct {
}
type TotpResult ¶
type TrackData ¶
type TrackData struct {
Typename string `json:"__typename"`
Name string `json:"name"`
URI string `json:"uri"`
TrackNumber int `json:"trackNumber"`
DiscNumber int `json:"discNumber"`
Playcount string `json:"playcount"`
MediaType string `json:"mediaType"`
TrackDuration TrackDuration `json:"trackDuration"`
Artists ArtistItems `json:"artists"`
AlbumOfTrack AlbumOfTrack `json:"albumOfTrack"`
Playability Playability `json:"playability"`
ContentRating ContentRating `json:"contentRating"`
}
func (TrackData) AlbumArtistNames ¶
func (TrackData) ArtistNames ¶
func (TrackData) LargestCoverURL ¶
type TrackDuration ¶
type TrackDuration struct {
TotalMilliseconds int `json:"totalMilliseconds"`
}
type TrackWrapperV2 ¶
Click to show internal directories.
Click to hide internal directories.