ympp

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Ympp

test Go Reference

Yandex music playlist parser in Go

Documentation

Index

Constants

View Source
const MusicHandlersURL = "https://music.yandex.ru/handlers"

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Album

type Album struct {
	ID    string `json:"id"`
	Title string `json:"title"`
}

type Artist

type Artist struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Library

type Library struct {
	Playlists []LibraryPlaylist `json:"playlists"`
}

type LibraryAPI

type LibraryAPI struct {
	// contains filtered or unexported fields
}

func NewDefaultLibraryAPI

func NewDefaultLibraryAPI() *LibraryAPI

func NewLibraryAPI

func NewLibraryAPI(baseurl string) *LibraryAPI

func (*LibraryAPI) GetLibrary

func (api *LibraryAPI) GetLibrary(ctx context.Context, login string) (library Library, err error)

func (*LibraryAPI) GetOwnerInfo

func (api *LibraryAPI) GetOwnerInfo(ctx context.Context, login string) (info OwnerInfo, err error)

func (*LibraryAPI) GetPlaylist

func (api *LibraryAPI) GetPlaylist(ctx context.Context, login string, playlist int) (playlistInfo PlaylistWithTracks, err error)

func (*LibraryAPI) SetUserAgent

func (api *LibraryAPI) SetUserAgent(ua string)

type LibraryPlaylist

type LibraryPlaylist struct {
	Playlist
}

type Owner

type Owner struct {
	UID   string `json:"uid"`
	Login string `json:"login"`
	Name  string `json:"name"`
}

type OwnerInfo

type OwnerInfo struct {
	Visibility string `json:"visibility"`
	HasTracks  bool   `json:"hasTracks"`
	Owner      Owner  `json:"owner"`
}

type Playlist

type Playlist struct {
	Revision             int    `json:"revision"`
	Kind                 int    `json:"kind"`
	Title                string `json:"title"`
	Description          string `json:"description"`
	DescriptionFormatted string `json:"descriptionFormatted"`
	TrackCount           int    `json:"trackCount"`
	Available            bool   `json:"available"`
}

type PlaylistWithTracks

type PlaylistWithTracks struct {
	Playlist
	Tracks []Track `json:"tracks"`
}

type Track

type Track struct {
	ID      string   `json:"id"`
	RealID  string   `json:"realID"`
	Title   string   `json:"title"`
	Artists []Artist `json:"artists"`
}

type Tracklist

type Tracklist struct {
	Playlist PlaylistWithTracks `json:"playlist"`
}

Jump to

Keyboard shortcuts

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