Documentation
¶
Overview ¶
Package resolve converts CLI arguments (files, directories, globs, URLs, M3U playlists, and RSS feeds) into a flat list of playlist tracks.
Index ¶
- Constants
- func CollectAudioFiles(path string) ([]string, error)
- func DownloadYTDL(pageURL, saveDir string) (string, error)
- func LocalPlaylist(path string) ([]playlist.Track, error)
- func Remote(urls []string) ([]playlist.Track, error)
- func ResolveYTDLBatch(pageURL string, start, count int) ([]playlist.Track, error)
- func SetYTDLCookiesFrom(browser string)
- type Result
Constants ¶
const YTDLRadioInitialItems = 20
YTDLRadioInitialItems is the number of tracks fetched in the first pass for YouTube Radio/Mix playlists. The UI uses this as the batch offset when starting incremental loading.
Variables ¶
This section is empty.
Functions ¶
func CollectAudioFiles ¶
CollectAudioFiles returns audio file paths for the given argument. If path is a directory, it walks it recursively collecting supported files. If path is a file with a supported extension, it returns it directly.
func DownloadYTDL ¶
DownloadYTDL downloads a single track via yt-dlp to the given directory and returns the output file path. Uses yt-dlp's default naming template.
func LocalPlaylist ¶
LocalPlaylist resolves a local M3U/M3U8 or PLS playlist file into tracks. Relative paths are resolved by the underlying parser against the playlist file's directory, matching normal playback import behavior.
func ResolveYTDLBatch ¶
ResolveYTDLBatch is like resolveYTDL but fetches a specific range [start, start+count) from the playlist. Exported for UI incremental loading. ResolveYTDLBatch fetches tracks starting at offset `start`. If count > 0, fetches at most `count` items; if count == 0, fetches all remaining.
func SetYTDLCookiesFrom ¶
func SetYTDLCookiesFrom(browser string)
SetYTDLCookiesFrom configures yt-dlp to use cookies from the given browser (e.g. "firefox", "chrome", "brave") for any --flat-playlist resolution. Pass an empty string to disable.