api

package
v0.0.0-...-33edafc Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() *client

Types

type AddFeedbackRequest

type AddFeedbackRequest struct {
	TrackToken string `json:"trackToken"`
	IsPositive bool   `json:"isPositive"`
}

type AddFeedbackResponse

type AddFeedbackResponse struct {
	ID        string `json:"feedbackId"`
	StationId string `json:"stationId"`
	MusicId   string `json:"musicId"`
	PandoraId string `json:"pandoraId"`

	IsPositive bool `json:"isPositive"`
}

type AddTiredRequest

type AddTiredRequest struct {
	TrackToken string `json:"trackToken"`
}

type AddTiredResponse

type AddTiredResponse struct{}

type Client

type Client interface {
	Login(username, password string) error
	GetStations() ([]pandora.Station, error)
	GetMoreTracks(stationId string) ([]pandora.Track, error)
	AddFeedback(trackToken string, isPositive bool) error
	AddTired(trackToken string) error
	GetNarrative(stationId, musicId string) (pandora.Narrative, error)
}

Client implements the Pandora REST API defined in https://6xq.net/pandora-apidoc/rest

type FragmentRequestReason

type FragmentRequestReason string
const (
	FragmentRequestReasonNormal FragmentRequestReason = "Normal"
	FragmentRequestReasonString FragmentRequestReason = "Skip"
)

type GetPlaylistFragmentRequest

type GetPlaylistFragmentRequest struct {
	StationID             string                `json:"stationId"`
	IsStationStart        bool                  `json:"isStationStart"`
	FragmentRequestReason FragmentRequestReason `json:"fragmentRequestReason"`
	AudioFormat           pandora.AudioFormat   `json:"audioFormat"`
	StartingAtTrackId     *string               `json:"startingAtTrackId"`

	OnDemandArtistMessageArtistUidHex *string `json:"onDemandArtistMessageArtistUidHex"`
	OnDemandArtistMessageIdHex        *string `json:"onDemandArtistMessageIdHex"`
}

type GetPlaylistFragmentResponse

type GetPlaylistFragmentResponse struct {
	Tracks          []pandora.Track `json:"tracks"`
	IsBingeSkipping bool            `json:"isBingeSkipping"`
}

type LegacyPartnerLoginRequest

type LegacyPartnerLoginRequest struct {
	LegacyRequest

	Username    string `json:"username"`
	Password    string `json:"password"`
	DeviceModel string `json:"deviceModel"`
	Version     string `json:"version"`

	IncludeURLs                bool `json:"includeUrls"`
	ReturnDeviceType           bool `json:"returnDeviceType"`
	ReturnUpdatePromptVersions bool `json:"returnUpdatePromptVersions"`
}

type LegacyPartnerLoginResponse

type LegacyPartnerLoginResponse struct {
	LegacyResponse
	Result LegacyPartnerLoginResponseResult `json:"result"`
}

type LegacyPartnerLoginResponseResult

type LegacyPartnerLoginResponseResult struct {
	EncryptedSyncTime string `json:"syncTime"`
	PartnerID         string `json:"partnerId"`
	PartnerAuthToken  string `json:"partnerAuthToken"`
}

type LegacyRequest

type LegacyRequest struct {
	SyncTime int64 `json:"syncTime,omitempty"`
}

type LegacyResponse

type LegacyResponse struct {
	Stat string `json:"stat"`
}

type LegacyUserLoginRequest

type LegacyUserLoginRequest struct {
	LegacyRequest

	LoginType        string `json:"loginType"`
	Username         string `json:"username"`
	Password         string `json:"password"`
	PartnerAuthToken string `json:"partnerAuthToken"`
}

type LegacyUserLoginResponse

type LegacyUserLoginResponse struct {
	LegacyResponse
	Result LegacyUserLoginResponseResult `json:"result"`
}

type LegacyUserLoginResponseResult

type LegacyUserLoginResponseResult struct {
	UserAuthToken string `json:"userAuthToken"`
}

type LoginRequest

type LoginRequest struct {
	ExistingAuthToken string `json:"existingAuthToken"`
	KeepLoggedIn      bool   `json:"keepLoggedIn"`
	Username          string `json:"username"`
	Password          string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	AuthToken     string `json:"authToken"`
	ListenerToken string `json:"listenerToken"`

	Username string `json:"username"`
	WebName  string `json:"webname"`

	HighQualityStreamingEnabled bool `json:"highQualityStreamingEnabled"`
}

type NarrativeRequest

type NarrativeRequest struct {
	MusicID   string `json:"musicId"`
	StationID string `json:"stationId"`
}

type StationRequest

type StationRequest struct {
	PageSize   int `json:"pageSize"`
	StartIndex int `json:"startIndex"`
}

type StationResponse

type StationResponse struct {
	TotalStations int               `json:"totalStations"`
	SortedBy      StationSortOrder  `json:"sortedBy"`
	Index         int               `json:"index"`
	Stations      []pandora.Station `json:"stations"`
}

type StationSortOrder

type StationSortOrder string
const StationSortOrderLastPlayed StationSortOrder = "lastPlayedTime"

Jump to

Keyboard shortcuts

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