provider

package
v0.0.0-...-53ca941 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Base62 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
)

Variables

View Source
var (
	ErrEmptyTrackList = errors.New("empty track list")
	ErrEmptyKuwoToken = errors.New("empty kuwo token")
	ErrEmptyKuwoLRC   = errors.New("empty kuwo lyric")
)
View Source
var (
	ErrStatusNotOK     = errors.New("status != 200")
	ErrNotImplemented  = errors.New("not implemented yet")
	ErrNoAuthorizeInfo = errors.New("no authorize info")
)
View Source
var (
	ErrEmptyMidURLInfoField = errors.New("empty MidURLInfo field")
	ErrEmptyPURL            = errors.New("empty PURL, may be VIP needed")
)
View Source
var (
	ErrEmptyKugouKRC = errors.New("empty kugou KRC")
)

Functions

func GetSongIDPattern

func GetSongIDPattern(provider string) *regexp.Regexp

Types

type IProvider

type IProvider interface {
	SearchSongs(keyword string, page int, limit int) (SearchResult, error)
	ResolveSongURL(song Song) (Song, error)
	ResolveSongLyric(song Song, format string) (Song, error)
	HotPlaylist(page int, limit int) (Playlists, error)
	PlaylistDetail(pl Playlist) (Songs, error)
	ArtistSongs(id string) (Songs, error)
	AlbumSongs(id string) (Songs, error)
	Name() string
	Login() error
	RefreshToken() error
}

func GetProvider

func GetProvider(provider string) IProvider

GetProvider return the specified provider

type Playlist

type Playlist struct {
	ID       string
	URL      string
	Image    string
	Title    string
	Provider string
}

type Playlists

type Playlists []Playlist

type SearchResult

type SearchResult []Song

type Song

type Song struct {
	ID       string
	Title    string
	URL      string
	Image    string
	Artist   string
	Provider string
	Lyric    string
}

type Songs

type Songs []Song

Jump to

Keyboard shortcuts

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