diff --git a/cmd/setup.go b/cmd/setup.go index d9fe11750..5638461eb 100644 --- a/cmd/setup.go +++ b/cmd/setup.go @@ -587,9 +587,9 @@ func providers() []providerSpec { section: "mixcloud", intro: []string{ "Browse and play Mixcloud shows through its public API and yt-dlp.", - "A username adds your public library, following stream, and creators.", + "A username adds your public library and followed creators.", "An optional developer access token adds /me and Listen Later.", - "Choose browser cookies for subscriber-only or signed-in playback.", + "Choose browser cookies for Stream and signed-in playback.", "Docs: cliamp.stream → docs/mixcloud.md", }, picker: &pickerSpec{ @@ -616,7 +616,6 @@ func providers() []providerSpec { onlyIf: func(v map[string]string) bool { return v[keyMixcloudBrowser] == "custom" }}, {key: "styles", label: "Music styles (optional)", help: "comma-separated; blank uses cliamp defaults"}, {key: "max_items", label: "Items per view", help: fmt.Sprintf("%d-%d", mixcloud.MinItems, mixcloud.MaxItemsLimit), defaultV: strconv.Itoa(mixcloud.DefaultMaxItems)}, - {key: "stream_creators", label: "Creators in Stream", help: fmt.Sprintf("%d-%d", mixcloud.MinItems, mixcloud.MaxStreamCreators), defaultV: strconv.Itoa(mixcloud.DefaultStreamCreators)}, }, extraValidate: func(v map[string]string) error { limits := []struct { @@ -624,7 +623,6 @@ func providers() []providerSpec { max int }{ {key: "max_items", label: "items per view", max: mixcloud.MaxItemsLimit}, - {key: "stream_creators", label: "stream creators", max: mixcloud.MaxStreamCreators}, } for _, field := range limits { n, err := strconv.Atoi(strings.TrimSpace(v[field.key])) @@ -637,7 +635,7 @@ func providers() []providerSpec { } return nil }, - owned: []string{"enabled", "username", "access_token", "cookies_from", "styles", "max_items", "stream_creators"}, + owned: []string{"enabled", "username", "access_token", "cookies_from", "styles", "max_items"}, body: func(v map[string]string) []config.KeyValue { kv := []config.KeyValue{rawKV("enabled", "true")} if username := strings.TrimSpace(v["username"]); username != "" { @@ -656,11 +654,7 @@ func providers() []providerSpec { if maxItems == "" { maxItems = strconv.Itoa(mixcloud.DefaultMaxItems) } - streamCreators := strings.TrimSpace(v["stream_creators"]) - if streamCreators == "" { - streamCreators = strconv.Itoa(mixcloud.DefaultStreamCreators) - } - return append(kv, rawKV("max_items", maxItems), rawKV("stream_creators", streamCreators)) + return append(kv, rawKV("max_items", maxItems)) }, }, { diff --git a/cmd/setup_test.go b/cmd/setup_test.go index cbfaf21bb..86502bb2a 100644 --- a/cmd/setup_test.go +++ b/cmd/setup_test.go @@ -854,7 +854,6 @@ func TestMixcloudSetupBody(t *testing.T) { "access_token": "token", "styles": "ambient, deep-house", "max_items": " 75 ", - "stream_creators": "15", } if err := spec.extraValidate(values); err != nil { t.Fatalf("extraValidate: %v", err) @@ -862,12 +861,11 @@ func TestMixcloudSetupBody(t *testing.T) { checkBody(t, spec.body(values), map[string]string{ "enabled": "true", "username": `"alice"`, "access_token": `"token"`, "cookies_from": `"firefox"`, "styles": `["ambient", "deep-house"]`, - "max_items": "75", "stream_creators": "15", + "max_items": "75", }) publicOnly := spec.body(map[string]string{ keyMixcloudBrowser: "none", "max_items": "100", - "stream_creators": "20", }) if _, ok := bodyValues(publicOnly)["cookies_from"]; ok { t.Fatalf("public-only session must not write cookies_from: %q", publicOnly) @@ -876,16 +874,15 @@ func TestMixcloudSetupBody(t *testing.T) { keyMixcloudBrowser: "custom", "cookies_from": "chrome:Profile 1", "max_items": "100", - "stream_creators": "20", }) checkBody(t, custom, map[string]string{"cookies_from": `"chrome:Profile 1"`}) if spec.validate != nil { t.Fatal("mixcloud setup should not claim a live validation probe") } - err := spec.extraValidate(map[string]string{"max_items": "bad", "stream_creators": "also bad"}) + err := spec.extraValidate(map[string]string{"max_items": "bad"}) if err == nil || !strings.Contains(err.Error(), "items per view") { - t.Fatalf("validation order error = %v, want items per view first", err) + t.Fatalf("validation error = %v, want items per view", err) } } diff --git a/config.toml.example b/config.toml.example index 305ddacb4..29d348054 100644 --- a/config.toml.example +++ b/config.toml.example @@ -263,11 +263,12 @@ eq = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # Mixcloud (optional, opt-in) # Public discovery, show search, the live genre catalogue, genre/tag search, # creator jumps, and Latest/Popular charts work with enabled=true. Set username -# for your following stream, profile activity, uploads, read-only show favorites, +# for profile activity, uploads, read-only show favorites, # listening history, collections, and followed-creator browsing. A developer # OAuth access_token makes /me the account identity and adds Listen Later. -# cookies_from is used by yt-dlp for signed-in playback only. styles is the -# local genre-favorites list; toggle it with [f] in Mixcloud's Genres browser. +# cookies_from supplies browser cookies via yt-dlp for cliamp's New Shows GraphQL +# requests and signed-in playback. yt-dlp handles playback, not feed requests. +# styles is the local genre-favorites list; toggle it with [f] in Mixcloud's Genres browser. # [mixcloud] # enabled = true # username = "yourname" @@ -275,7 +276,6 @@ eq = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] # cookies_from = "firefox" # chrome, brave, edge, chromium, opera, safari, vivaldi, whale… # styles = ["ambient", "deep-house", "house", "jazz", "techno"] # max_items = 100 -# stream_creators = 20 # --- # NetEase Cloud Music (optional, opt-in) diff --git a/config/config.go b/config/config.go index efb142d86..265c70fe6 100644 --- a/config/config.go +++ b/config/config.go @@ -565,18 +565,17 @@ func (s *SoundCloudConfig) set(key, val string) { // MixcloudConfig holds settings for the Mixcloud provider. Public discovery // works with only enabled=true. Username adds public account views; an access -// token adds /me and Listen Later; browser cookies are used only by yt-dlp for -// playback that needs the listener's signed-in Mixcloud session. +// token adds /me and Listen Later; browser cookies enable Stream and signed-in +// playback. // Enable rule: opt-in. type MixcloudConfig struct { - Enabled bool - Username string - AccessToken string - CookiesFrom string - Styles []string - StylesSet bool // distinguishes omitted styles (defaults) from an explicit empty list - MaxItems int - StreamCreators int + Enabled bool + Username string + AccessToken string + CookiesFrom string + Styles []string + StylesSet bool // distinguishes omitted styles (defaults) from an explicit empty list + MaxItems int } // IsSet reports whether the Mixcloud provider should be shown. @@ -602,10 +601,6 @@ func (m *MixcloudConfig) set(key, val string) { if v, ok := parseInt(val); ok { m.MaxItems = v } - case "stream_creators": - if v, ok := parseInt(val); ok { - m.StreamCreators = v - } } } diff --git a/config/config_golden_test.go b/config/config_golden_test.go index b37974a10..5850a8e7f 100644 --- a/config/config_golden_test.go +++ b/config/config_golden_test.go @@ -131,7 +131,6 @@ access_token = mc#token cookies_from = "brave" styles = ["ambient", "deep-house"] max_items = 50 -stream_creators = 10 [netease] enabled = true @@ -271,14 +270,13 @@ func TestLoadGolden(t *testing.T) { sectionsWant.Podcast = PodcastConfig{Country: "no"} sectionsWant.SoundCloud = SoundCloudConfig{Enabled: true, User: "sc-user", CookiesFrom: "chrome"} sectionsWant.Mixcloud = MixcloudConfig{ - Enabled: true, - Username: "mc-user", - AccessToken: "mc#token", - CookiesFrom: "brave", - Styles: []string{"ambient", "deep-house"}, - StylesSet: true, - MaxItems: 50, - StreamCreators: 10, + Enabled: true, + Username: "mc-user", + AccessToken: "mc#token", + CookiesFrom: "brave", + Styles: []string{"ambient", "deep-house"}, + StylesSet: true, + MaxItems: 50, } sectionsWant.NetEase = NetEaseConfig{Enabled: true, CookiesFrom: "chrome:Profile 1", CookiesFile: "/home/user/cookies.txt", UserID: "42"} sectionsWant.Yandex = YandexConfig{Enabled: true, Token: "y0_token"} @@ -363,14 +361,13 @@ func TestLoadGolden(t *testing.T) { } allWant.SoundCloud = SoundCloudConfig{Enabled: true, User: "yourname", CookiesFrom: "firefox"} allWant.Mixcloud = MixcloudConfig{ - Enabled: true, - Username: "yourname", - AccessToken: "mc-env-token", - CookiesFrom: "firefox", - Styles: []string{"ambient", "deep-house", "house", "jazz", "techno"}, - StylesSet: true, - MaxItems: 100, - StreamCreators: 20, + Enabled: true, + Username: "yourname", + AccessToken: "mc-env-token", + CookiesFrom: "firefox", + Styles: []string{"ambient", "deep-house", "house", "jazz", "techno"}, + StylesSet: true, + MaxItems: 100, } allWant.NetEase = NetEaseConfig{ Enabled: true, diff --git a/config/mixcloud_test.go b/config/mixcloud_test.go index 5df761ada..60d77453c 100644 --- a/config/mixcloud_test.go +++ b/config/mixcloud_test.go @@ -22,7 +22,6 @@ access_token = "${CLIAMP_TEST_MIXCLOUD_TOKEN}" cookies_from = "firefox" styles = ["ambient", "deep-house"] max_items = 75 -stream_creators = 15 `) if err := os.WriteFile(path, data, 0o600); err != nil { t.Fatal(err) @@ -35,7 +34,7 @@ stream_creators = 15 if !cfg.Mixcloud.IsSet() || cfg.Mixcloud.Username != "alice" || cfg.Mixcloud.AccessToken != "secret-token" || cfg.Mixcloud.CookiesFrom != "firefox" { t.Fatalf("Mixcloud config = %+v", cfg.Mixcloud) } - if !slices.Equal(cfg.Mixcloud.Styles, []string{"ambient", "deep-house"}) || cfg.Mixcloud.MaxItems != 75 || cfg.Mixcloud.StreamCreators != 15 { + if !slices.Equal(cfg.Mixcloud.Styles, []string{"ambient", "deep-house"}) || cfg.Mixcloud.MaxItems != 75 { t.Fatalf("Mixcloud limits/styles = %+v", cfg.Mixcloud) } if !cfg.Mixcloud.StylesSet { diff --git a/docs/configuration.md b/docs/configuration.md index 3853b1248..166b6667c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -469,11 +469,12 @@ native show search, direct creator jumps, and playback need no account: enabled = true ``` -Add `username` for your following stream, activity, uploads, read-only show +Add `username` for activity, uploads, read-only show favorites, listening history, collections, and followed-creator browsing. An optional developer `access_token` sets `/me/` as the account identity and adds -Listen Later. `cookies_from` gives yt-dlp your signed-in browser session for -playback that requires it. +Listen Later. For Stream (New Shows), cliamp makes GraphQL requests using browser +cookies loaded through yt-dlp via `cookies_from`. Playback uses yt-dlp, with the +same browser session when required. ```toml [mixcloud] @@ -483,7 +484,6 @@ access_token = "${MIXCLOUD_ACCESS_TOKEN}" cookies_from = "firefox" styles = ["ambient", "deep-house", "jazz", "techno"] max_items = 100 -stream_creators = 20 ``` The `styles` list is also the local genre-favorites list for the provider. In diff --git a/docs/mixcloud.md b/docs/mixcloud.md index b4a435c16..a3ba2325f 100644 --- a/docs/mixcloud.md +++ b/docs/mixcloud.md @@ -13,7 +13,7 @@ pipeline. Put `yt-dlp` and `ffmpeg` on `PATH`. | Live category catalogue and Latest/Popular genre charts | Provider enabled | **Genres** in the provider pane or `N` browser | | Genre/tag search and local genre favorites | Provider enabled and writable config file | `/`, `Enter`, and `f` in **Genres** | | Public profile activity, uploads, show favorites, listening history, and collections | Public profile `username`, or an `access_token` | **Your Mixcloud** and **Collections** sections | -| Following stream and followed-creator browser | Public profile `username`, or an `access_token` | **Stream (Following Releases)** and **Creators** | +| Following stream and followed-creator browser | Public profile `username`, or an `access_token`; Stream also needs `cookies_from` | **Stream (New Shows)** and **Creators** | | Open a highlighted show's creator Uploads/Favorites | Provider enabled; account not required | Press `N` on a Mixcloud show | | Listen Later | Developer OAuth `access_token` | **Your Mixcloud** section | | Signed-in or subscriber-gated playback | `cookies_from` for a supported browser with a Mixcloud session | Playback through yt-dlp | @@ -65,7 +65,7 @@ Press `X` to select Mixcloud. The provider pane has these sections. | Section | Entry | Behaviour | |---|---|---| -| **Your Mixcloud** | **Stream (Following Releases)** | Merges recent uploads from followed creators. See [Limits and tuning](#limits-and-tuning). | +| **Your Mixcloud** | **Stream (New Shows)** | Appears only when `cookies_from` is set. Reads the signed-in browser account's feed. See [Limits and tuning](#limits-and-tuning). | | **Your Mixcloud** | **Favorites** | Reads the configured public account or the token owner `/me/` connections | | **Your Mixcloud** | **Creators** | Lists the configured account and followed creators. Separates each creator **Uploads** and **Favorites**. | | **Your Mixcloud** | **Uploads**, **Profile Activity**, **Listening History** | Reads the configured public account or the token owner `/me/` connections | @@ -76,8 +76,10 @@ Press `X` to select Mixcloud. The provider pane has these sections. | **Discover** | **Recent Releases**, **Popular** | Global public discovery. No account required. | | **Music Styles** | `