search

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package search provides the required metadata and youtube link to download a song.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSpotifyClient

func GetSpotifyClient(clientId, clientSecret string) (*spotify.Client, error)

GetSpotifyClient returns a spotify client that's used for searching and getting metadata from spotify.

func GetYoutubeLink(songName string, songArtists []string) (string, error)

GetYoutubeLink takes a song's name and its artists' names and returns it's youtube link

Types

type Song

type Song struct {
	*spotify.FullTrack
	YoutubeLink string
}

func GetAlbumTracks

func GetAlbumTracks(client *spotify.Client, spotifyId spotify.ID) ([]*Song, error)

GetAlbumTracks gets all the tracks in in album using its spotify id.

func GetPlaylistTracks

func GetPlaylistTracks(client *spotify.Client, spotifyId spotify.ID) ([]*Song, error)

GetPlaylistTracks gets all the songs of a playlist using its spotify id.

func (*Song) FromId

func (s *Song) FromId(client *spotify.Client, spotifyId spotify.ID) error

FromId sets the metadata and the yt link of the underlying Song `s` from the spotify id of a track.

func (*Song) FromPlaylistTrack

func (s *Song) FromPlaylistTrack(playlistTrack *spotify.PlaylistTrack) error

FromPlaylistTrack sets the underlying Songs `FullTrack` and yt link by using a PlaylistTrack

func (*Song) FromQuery

func (s *Song) FromQuery(client *spotify.Client, query string) error

FromQuery gets search for the `query` and get's sets the metadata and yt link of the underlying Song `s`

func (*Song) FromSimpleTrack

func (s *Song) FromSimpleTrack(client *spotify.Client, simpleTrack *spotify.SimpleTrack) error

FromSimpleTrack sets the underlying Songs `FullTrack` and yt link by using a SimpleTrack

Jump to

Keyboard shortcuts

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