song

package
v0.0.0-...-5190cbe Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser string
const (
	ParserKkdai Parser = "fast"
	ParserYtdlp Parser = "slow"
)

func (Parser) String

func (p Parser) String() string

type Platform

type Platform string
const (
	YouTube     Platform = "YouTube"
	Soundcloud  Platform = "Soundcloud"
	Bandcamp    Platform = "Bandcamp"
	FiftySixCom Platform = "56.com"
	DailyMotion Platform = "DailyMotion"
	Vimeo       Platform = "Vimeo"
)

type Song

type Song struct {
	Title          string        // title of the song
	PublicLink     string        // link to the song page
	StreamURL      string        // URL for streaming the song
	StreamFilepath string        // path for streaming the song
	Thumbnail      Thumbnail     // thumbnail image for the song
	Duration       time.Duration // duration of the song
	SongID         string        // unique ID for the song
	Source         SongSource    // source type of the song
	Parser         string
}

func New

func New() *Song

func (*Song) FetchSongs

func (s *Song) FetchSongs(input string, parser Parser) ([]*Song, error)

func (*Song) FindPlatformByURL

func (s *Song) FindPlatformByURL(url string) Platform

func (*Song) GetSongInfo

func (s *Song) GetSongInfo(song *Song) (string, string, string, string, error)

type SongSource

type SongSource int32
const (
	SourcePlatform SongSource = iota
	SourceInternet
	SourceFile
)

func (SongSource) String

func (source SongSource) String() string

type Thumbnail

type Thumbnail struct {
	URL    string
	Width  uint
	Height uint
}

Jump to

Keyboard shortcuts

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