resolve

package
v1.60.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 27 Imported by: 0

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

View Source
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

func CollectAudioFiles(path string) ([]string, error)

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

func DownloadYTDL(pageURL, saveDir string) (string, error)

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

func LocalPlaylist(path string) ([]playlist.Track, error)

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 Remote

func Remote(urls []string) ([]playlist.Track, error)

Remote fetches feed and M3U URLs and returns the resolved tracks.

func ResolveYTDLBatch

func ResolveYTDLBatch(pageURL string, start, count int) ([]playlist.Track, error)

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.

Types

type Result

type Result struct {
	Tracks  []playlist.Track // local files, dirs, plain stream URLs
	Pending []string         // feed/M3U URLs to resolve asynchronously
}

Result holds the output of Args: instantly-resolved tracks and remote URLs (feeds, M3U) that need async HTTP fetching.

func Args

func Args(args []string) (Result, error)

Args separates CLI arguments into immediately-resolved local tracks and pending remote URLs (feeds, M3U) that require HTTP fetching.

Jump to

Keyboard shortcuts

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