296 lines
11 KiB
Go
296 lines
11 KiB
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
type spotifyTrack struct {
|
||
|
Album struct {
|
||
|
AlbumType string `json:"album_type"`
|
||
|
Artists []struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"artists"`
|
||
|
AvailableMarkets []string `json:"available_markets"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Images []struct {
|
||
|
Height int `json:"height"`
|
||
|
URL string `json:"url"`
|
||
|
Width int `json:"width"`
|
||
|
} `json:"images"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"album"`
|
||
|
Artists []struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"artists"`
|
||
|
AvailableMarkets []string `json:"available_markets"`
|
||
|
DiscNumber int `json:"disc_number"`
|
||
|
DurationMs int `json:"duration_ms"`
|
||
|
Explicit bool `json:"explicit"`
|
||
|
ExternalIds struct {
|
||
|
Isrc string `json:"isrc"`
|
||
|
} `json:"external_ids"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Popularity int `json:"popularity"`
|
||
|
PreviewURL string `json:"preview_url"`
|
||
|
TrackNumber int `json:"track_number"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
IsLocal bool `json:"is_local"`
|
||
|
}
|
||
|
|
||
|
type spotifyPlaylist struct {
|
||
|
Collaborative bool `json:"collaborative"`
|
||
|
Description interface{} `json:"description"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Followers struct {
|
||
|
Href interface{} `json:"href"`
|
||
|
Total int `json:"total"`
|
||
|
} `json:"followers"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Images []struct {
|
||
|
Height int `json:"height"`
|
||
|
URL string `json:"url"`
|
||
|
Width int `json:"width"`
|
||
|
} `json:"images"`
|
||
|
Name string `json:"name"`
|
||
|
Owner struct {
|
||
|
DisplayName interface{} `json:"display_name"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"owner"`
|
||
|
Public bool `json:"public"`
|
||
|
SnapshotID string `json:"snapshot_id"`
|
||
|
Tracks struct {
|
||
|
Href string `json:"href"`
|
||
|
Items []struct {
|
||
|
AddedAt time.Time `json:"added_at"`
|
||
|
AddedBy struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"added_by"`
|
||
|
IsLocal bool `json:"is_local"`
|
||
|
Track struct {
|
||
|
Album struct {
|
||
|
AlbumType string `json:"album_type"`
|
||
|
Artists []struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"artists"`
|
||
|
AvailableMarkets []interface{} `json:"available_markets"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Images []struct {
|
||
|
Height int `json:"height"`
|
||
|
URL string `json:"url"`
|
||
|
Width int `json:"width"`
|
||
|
} `json:"images"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"album"`
|
||
|
Artists []struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"artists"`
|
||
|
AvailableMarkets []interface{} `json:"available_markets"`
|
||
|
DiscNumber int `json:"disc_number"`
|
||
|
DurationMs int `json:"duration_ms"`
|
||
|
Explicit bool `json:"explicit"`
|
||
|
ExternalIds struct {
|
||
|
Isrc string `json:"isrc"`
|
||
|
} `json:"external_ids"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Popularity int `json:"popularity"`
|
||
|
PreviewURL interface{} `json:"preview_url"`
|
||
|
TrackNumber int `json:"track_number"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"track"`
|
||
|
} `json:"items"`
|
||
|
Limit int `json:"limit"`
|
||
|
Next string `json:"next"`
|
||
|
Offset int `json:"offset"`
|
||
|
Previous interface{} `json:"previous"`
|
||
|
Total int `json:"total"`
|
||
|
} `json:"tracks"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
}
|
||
|
|
||
|
type spotifyPlaylistsOfUser struct {
|
||
|
Href string `json:"href"`
|
||
|
Items []struct {
|
||
|
Collaborative bool `json:"collaborative"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Images []struct {
|
||
|
Height int `json:"height"`
|
||
|
URL string `json:"url"`
|
||
|
Width int `json:"width"`
|
||
|
} `json:"images"`
|
||
|
Name string `json:"name"`
|
||
|
Owner struct {
|
||
|
DisplayName interface{} `json:"display_name"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"owner"`
|
||
|
Public bool `json:"public"`
|
||
|
SnapshotID string `json:"snapshot_id"`
|
||
|
Tracks struct {
|
||
|
Href string `json:"href"`
|
||
|
Total int `json:"total"`
|
||
|
} `json:"tracks"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"items"`
|
||
|
Limit int `json:"limit"`
|
||
|
Next *string `json:"next"`
|
||
|
Offset int `json:"offset"`
|
||
|
Previous interface{} `json:"previous"`
|
||
|
Total int `json:"total"`
|
||
|
}
|
||
|
|
||
|
type spotifyPlaylistsTracks struct {
|
||
|
Href string `json:"href"`
|
||
|
Items []struct {
|
||
|
AddedAt time.Time `json:"added_at"`
|
||
|
AddedBy struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"added_by"`
|
||
|
IsLocal bool `json:"is_local"`
|
||
|
Track struct {
|
||
|
Album struct {
|
||
|
AlbumType string `json:"album_type"`
|
||
|
Artists []struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"artists"`
|
||
|
AvailableMarkets []interface{} `json:"available_markets"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Images []struct {
|
||
|
Height int `json:"height"`
|
||
|
URL string `json:"url"`
|
||
|
Width int `json:"width"`
|
||
|
} `json:"images"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"album"`
|
||
|
Artists []struct {
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"artists"`
|
||
|
AvailableMarkets []interface{} `json:"available_markets"`
|
||
|
DiscNumber int `json:"disc_number"`
|
||
|
DurationMs int `json:"duration_ms"`
|
||
|
Explicit bool `json:"explicit"`
|
||
|
ExternalIds struct {
|
||
|
Isrc string `json:"isrc"`
|
||
|
} `json:"external_ids"`
|
||
|
ExternalUrls struct {
|
||
|
Spotify string `json:"spotify"`
|
||
|
} `json:"external_urls"`
|
||
|
Href string `json:"href"`
|
||
|
ID string `json:"id"`
|
||
|
Name string `json:"name"`
|
||
|
Popularity int `json:"popularity"`
|
||
|
PreviewURL interface{} `json:"preview_url"`
|
||
|
TrackNumber int `json:"track_number"`
|
||
|
Type string `json:"type"`
|
||
|
URI string `json:"uri"`
|
||
|
} `json:"track"`
|
||
|
} `json:"items"`
|
||
|
Limit int `json:"limit"`
|
||
|
Next *string `json:"next"`
|
||
|
Offset int `json:"offset"`
|
||
|
Previous *string `json:"previous"`
|
||
|
Total int `json:"total"`
|
||
|
}
|