soundcloud

package
v1.60.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package soundcloud implements a playlist.Provider backed by yt-dlp.

SoundCloud is opt-in: it only registers when soundcloud enabled = true is set in config. Once enabled, search uses yt-dlp's "scsearch:" protocol and works without further configuration. When soundcloud user is set, browse exposes that profile's Tracks, Likes, and Reposts — public for most accounts. With cookies_from set, yt-dlp picks up the user's browser session for subscriber-gated content.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled     bool   // true only when user explicitly sets enabled = true
	User        string // SoundCloud username (the path segment, e.g. "yourname"). Optional.
	CookiesFrom string // browser name for yt-dlp --cookies-from-browser (e.g. "firefox"). Optional.
}

Config holds settings for the SoundCloud provider.

func (Config) IsSet

func (c Config) IsSet() bool

IsSet reports whether the SoundCloud provider should be exposed. SoundCloud is opt-in: requires enabled = true in soundcloud.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements playlist.Provider and provider.Searcher for SoundCloud via yt-dlp.

func NewFromConfig

func NewFromConfig(cfg Config) *Provider

NewFromConfig returns a provider, or nil when SoundCloud is not enabled. Sets resolve's yt-dlp cookies as a side effect when CookiesFrom is non-empty so any yt-dlp invocation (search, browse, playback) uses the user's signed-in session.

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Playlists

func (p *Provider) Playlists() ([]playlist.PlaylistInfo, error)

Playlists exposes the configured user's Tracks, Likes, and Reposts when a username is set; otherwise a curated set of genre searches so the empty state has something playable. Ctrl+F always opens search regardless.

func (*Provider) SearchTracks

func (p *Provider) SearchTracks(_ context.Context, query string, limit int) ([]playlist.Track, error)

SearchTracks runs `yt-dlp scsearch{limit}:{query}` and returns matched tracks. Implements provider.Searcher.

func (*Provider) Tracks

func (p *Provider) Tracks(playlistID string) ([]playlist.Track, error)

Tracks resolves a SoundCloud page URL (or scsearch query) via yt-dlp. The playlistID is the value produced by Playlists.

Jump to

Keyboard shortcuts

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