input

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package input expands and classifies user-provided URL inputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flatten

func Flatten(args []string) ([]string, error)

Flatten expands CLI arguments and text files into one deduplicated URL list. Empty lines and lines starting with '#' are ignored to make URL lists convenient for manual editing.

Types

type ClassifiedURLs

type ClassifiedURLs struct {
	// Zvuk lists URLs classified as Zvuk provider inputs.
	Zvuk []string
	// Yandex lists URLs classified as Yandex Music provider inputs.
	Yandex []string
	// Unknown lists URLs that could not be classified to a known provider.
	Unknown []string
}

ClassifiedURLs groups flattened input URLs by source provider.

func Classify

func Classify(values []string) *ClassifiedURLs

Classify groups URLs by provider while preserving input order inside each group.

type Provider

type Provider string

Provider identifies the external music source inferred from an input URL.

const (
	// ProviderZvuk identifies zvuk.com URLs.
	ProviderZvuk Provider = "zvuk"
	// ProviderYandex identifies music.yandex.* URLs.
	ProviderYandex Provider = "yandex"
	// ProviderUnknown is used for unsupported URLs.
	ProviderUnknown Provider = "unknown"
)

func ClassifyURL

func ClassifyURL(raw string) Provider

ClassifyURL infers provider from a URL host.

Jump to

Keyboard shortcuts

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