ClaudeMods
☰
ZH-CN
● 0 人在线 · 浏览 0 次
赞助提交作品
GitHub 仓库 · 发布者 KTCrisis

jukebox7

在 Claude Code 会话内用普通语言点播音乐,无需浏览器即可播放。

已翻译

关于这个 mod

jukebox7 是 Claude Code 插件,可在会话内用自然语言点播音乐。包含音乐名称的提示会交给 Haiku 做意图分类(播放、切换、下一首、相似、音量、停止)。它使用 yt-dlp 搜索 YouTube Music/YouTube,并通过 HTTP 接口控制隐藏的 VLC 实例串流音频;/music 面板显示标题、状态、音量和类型单选按钮。需要带 Windows 互操作的 WSL、PATH 中的 yt-dlp 和已安装的 VLC。

安装

请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。

claude plugin marketplace add KTCrisis/flux7-mods
claude plugin install jukebox7
原文 / README

jukebox7

Music on demand inside a Claude Code session, asked in plain words, played without a browser.

What it does

A prompt that names music (put on some ambient, coupe la musique, next) goes to Haiku first, which answers one intent: play, toggle, next, similar, volume, stop, or none. Anything else, including requests aimed at play7, keys7, Renoise or a melody, reaches the session untouched; a prompt without a music word skips the model call altogether.

  • play: yt-dlp searches YouTube, keeps songs of two to twenty minutes (a mood asked in words prefers five and more), and streams the audio into Windows' VLC with its dummy interface: no window, no focus taken. The track asked for plays whatever its length; next walks the songs alone, and past the last one the list ends.
  • toggle / next / stop: the WSL side runs in a process group of its own (setsid); pause is VLC's own pl_forcepause over its HTTP interface, at once, stop is CONT then TERM, and the vlc.exe it started is terminated by its --meta-title=jukebox7 tag, so a VLC opened by hand is never touched. A pause VLC does not answer changes nothing and says so. One change of song runs at a time (a search takes up to 40 s): a press meanwhile is refused. A session that never played leaves the VLC alone when it ends.

The pane (/music, or opened on the first song) shows the title, its state and volume, p pause, n next, r similar, s stop, d and u the volume by 10 %, and the genre buttons 1 to 9 and 0: ambient, lofi, metal, synth & electro, idm, indie rock, video games, modern classical, hip-hop, post-rock. A genre is a radio: a random artist from its list, a random song of theirs; next and the end of a song roll again.

A pick searches YouTube Music's songs tab, which holds tracks only: no interview, gameplay or full OST. Its listing gives no length: yt-dlp is asked for it once the song plays, the bar shows the elapsed time until then; plain YouTube, kept to two to twenty minutes, is the fallback when it finds nothing.

Discoveries. Each genre also holds a few artists beyond the listener's own, drawn from the lists' neighbors (Grouper and Tim Hecker by Loscil and Brian Eno, Deathspell Omega and Panopticon by Blut Aus Nord and Agalloch, Sewerslvt and Machine Girl by Venetian Snares, Car Seat Headrest and Alex G by Modest Mouse and Elliott Smith). One pick in three comes from there and its title wears a ✦; strike a name from discover to drop it.

similar (r, /music similar, or in words, plus comme ça) plays the YouTube Music radio of the song on: other artists first (the radio lingers on the same one), covers, tributes and hour-long loops dropped; next walks that list.

On the terminal the pane is black down to its last row, framed in the avatar's color, and the room left under the player fills with a green code rain in the manner of Ghost in the Shell: half-width katakana and digits, falling five frames a second while a song plays, frozen on pause.

With avatar7 loaded, a plays the pick of the avatar on duty: the station of its persona.json, which avatar7 publishes in its station state. Each song that starts, asked, from a genre or chained when the last one ends, is written to this mod's say state: avatar7, if loaded, introduces it in the persona's manner, like a radio host over the intro. While the avatar speaks (its isVoicing state) the music drops to 70 % of its level, then returns.

/music <search> plays one named track; /music pause|next|stop; /music vol 60, /music vol +20. In words, monte le son works too.

Only a short prompt (eight words at most) with a music word or phrase goes to Haiku; a longer one is talk to the assistant and passes untouched, even when it mentions music.

The volume goes through VLC's HTTP interface on Windows' loopback (port 18797), reached with Windows' own curl.exe. The level is kept apart from the player, survives a stop, and is set again on each new song: a fresh VLC starts at whatever level Windows kept for it.

Requirements

WSL with Windows interop, yt-dlp on the path, VLC at C:\Program Files\VideoLAN\VLC. VLC rather than ffplay on WSLg's PulseAudio: that server stalls after a sleep (it takes audio at a tenth of real time and nothing comes out) until wsl --shutdown.

Limits

  • The genre lists are one listener's; edit GENRES in hooks/register.tsx. A station belongs to its persona, in avatar7's personas/<id>/persona.json.
  • A very long pause may let YouTube drop the stream behind VLC, which then ends the song early on resume.
  • A song that ends moves on within five seconds (the liveness poll).

Tests

claude plugin test ~/flux7-mods/jukebox7

更多类似作品