lib

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YOUTUBE_API_URL = "https://www.googleapis.com/youtube/v3/search?part=snippet&q=%s&type=video&key=%s"
	YOUTUBEDL_CMD   = "(cd %s && youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 %s)"
	DOWNLOAD_PATH   = "data"
	AMPLIFY_RATIO   = 1
	TIMEOUT_SECONDS = 2
	FILENAME_CMD    = "find %s/ | grep \"%s\" | grep '.mp3'"
	AMPLIFY_CMD     = "ffmpeg -i \"%s\" -filter:a \"volume=%d\" \"%s\" && rm \"%s\""
)
View Source
const (
	SPOTIFY_AUTH_URL           = "https://accounts.spotify.com/api/token"
	SPOTIFY_PLAYLIST_ITEMS_URL = "https://api.spotify.com/v1/playlists/%s/tracks"
	BASIC_HEADER               = "Basic %s"
	BEARER_AUTHORIZATION       = "Bearer %s"
)

Variables

This section is empty.

Functions

func AmplifyAudio

func AmplifyAudio(track_id string) error

func DownloadTrack

func DownloadTrack(track_id string) error

func GetPlaylistItems

func GetPlaylistItems(playlist, token string) ([]string, error)

func SpotifyLogin

func SpotifyLogin() (string, error)

func YoutubeSearch

func YoutubeSearch(query string, verbose bool) (map[int]string, error)

Types

type Auth

type Auth struct {
	Token string `json:"access_token"`
}

type Songs

type Songs struct {
	Items []struct {
		Track struct {
			Artists []struct {
				Name string `json:"name"`
			} `json:"artists"`
			Name string `json:"name"`
		} `json:"track"`
	} `json:"items"`
}

Jump to

Keyboard shortcuts

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