ytmusicapi

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 6 Imported by: 0

README

go-ytmusicapi

A helper library for interacting with youtube music. check examples for a guide on how to use it.

At the moment, the following functionalities exist

FetchPlaylist

FetchPlaylistTracks

FetchAllPlaylistTracks

FetchUserPlaylists

CreatePlaylist

AddTracksToPlaylist

FetchLikedPlaylist

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTracksToPlaylist

func AddTracksToPlaylist(client *http.Client, playlistId string, videoIds []string) error

AddTracksToPlaylist adds the given video IDs to an existing playlist

func ReadValue

func ReadValue(object interface{}, arrayOfkeys []interface{}) interface{}

ReadValue navigates through nested JSON structure using a path of string or int keys

func ReadValueString

func ReadValueString(object interface{}, arrayOfkeys []interface{}) string

ReadValueString reads a string value from a nested JSON structure

Types

type CreatedPlaylist

type CreatedPlaylist = parsers.CreatedPlaylist

func CreatePlaylist

func CreatePlaylist(client *http.Client, title string, description string, videoIds []string) (CreatedPlaylist, error)

CreatePlaylist creates a new private playlist and returns its details

type PlaylistAllTracksResponse

type PlaylistAllTracksResponse = parsers.PlaylistAllTracksResponse

func FetchAllPlaylistTracks

func FetchAllPlaylistTracks(client *http.Client, playlistId string) (PlaylistAllTracksResponse, error)

FetchAllPlaylistTracks fetches every track in a playlist, paginating automatically

type PlaylistDetails

type PlaylistDetails = parsers.PlaylistDetails

func FetchPlaylist

func FetchPlaylist(client *http.Client, playlistId string) (PlaylistDetails, error)

FetchPlaylist returns the details of a playlist by ID

type PlaylistPageResponse

type PlaylistPageResponse = parsers.PlaylistPageResponse

func FetchUserPlaylists

func FetchUserPlaylists(httpClient *http.Client, continuation string) (PlaylistPageResponse, error)

FetchUserPlaylists returns a page of the authenticated user's playlists. Pass an empty continuation string to fetch the first page.

type PlaylistTracksResponse

type PlaylistTracksResponse = parsers.PlaylistTracksResponse

func FetchPlaylistTracks

func FetchPlaylistTracks(client *http.Client, playlistId string, continuation string) (PlaylistTracksResponse, error)

FetchPlaylistTracks returns a page of tracks for a playlist. Pass an empty continuation string to fetch the first page.

type SearchQuery

type SearchQuery struct {
	Title   string
	Artists []string
	Type    string
}

SearchQuery specifies the parameters for a track search

type Track

type Track = parsers.Track

Re-export types from parsers package

func Search(client *http.Client, searchQuery SearchQuery) ([]Track, error)

Search returns tracks matching the given query

func SearchOne

func SearchOne(client *http.Client, searchQuery SearchQuery) (Track, error)

SearchOne returns the top matching track for the given query

type YoutubePlaylist

type YoutubePlaylist = parsers.YoutubePlaylist

func FetchLikedPlaylist

func FetchLikedPlaylist(client *http.Client) (YoutubePlaylist, error)

FetchLikedPlaylist returns the authenticated user's "Liked Music" playlist

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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