Introduction¶
DSH’s plugin architecture allows mounting Web capabilities into the DSH runtime environment. dsh-MusicPlayer targets a specific scenario: while engaging in a DSH Web conversation, you want to play, pause, or switch songs, or have the agent control playback via natural language, rather than leaving the chat page to operate a music client.
Below is an introduction to this plugin’s positioning, verified capabilities, installation and enablement methods, and notes.
What is this¶
dsh-MusicPlayer is a DSH Web plugin maintained by xiekai886, licensed under MIT. It provides a floating player, integrates with Netease Cloud Music playlists and single song search, and exposes a music tool for the agent to call, synchronizing the browser player with the host state machine.
Core Features¶
Floating Player¶
The player is located in the bottom right corner of the page, a small dark frosted glass card. It is draggable and remembers position automatically; expand/collapse with animation. Supports play/pause, previous/next, click progress bar, volume, loop/single-loop/shuffle, and playlist.
The frontend is hand-coded in a custom __ModuleLoader__ format, using inline SVG icons, and does not depend on a CDN.
Netease Cloud Music Integration¶
Supports import/switching playlists: paste link or ID. Supports searching for single songs and adding them to the playlist. The host side proxies search, playlists, and audio streams, bypassing browser CORS and anti-hotlinking, and supports Meting same-origin parsing.
Default Playlist¶
The environment variable DSH_MUSIC_PLAYLIST can be configured to specify a playlist ID. It is automatically loaded as the built-in library at startup; if not configured, the playlist is empty and can be manually imported.
Agent Music Tool¶
Provides a music tool supporting playing specific songs, importing playlists, searching, skipping songs, pausing, adjusting volume, switching modes, showing/hiding the default playlist, and viewing/adding/removing the queue.
State Synchronization¶
The browser player and host state machine synchronize via REST:
- Poll state:
/dsh-music/state - Control commands:
/dsh-music/command
No persistence; the default library is freshly loaded every time it starts.
Installation and Enablement¶
Installation requires DSH CLI and pnpm. Below are example installation commands based on verified information:
dsh plugin --profile web add "github:你的用户名/dsh-music"
Note: github:你的用户名/dsh-music in the command is a placeholder example; no actual complete repository or package name installation command was provided. Before actually enabling, please refer to the installation instructions in the repository README, do not directly concatenate unverified repository addresses.
After installation, dsh web needs to be restarted:
dsh --profile web
Typical Usage¶
-
Click the bottom-right player card to expand; drag any position at the top of the card to move, position is remembered automatically; click the top-right arrow to expand/collapse.
-
Click the search entry to enter Netease search: enter song name or artist, press Enter to search; click + to add to the playlist.
-
Paste the Netease playlist link or ID into the first input box in the chat, press Enter to import, replacing the current library.
-
Enter natural language control in the chat, for example:
- “Play a song”
- “Play Jay Chou’s ‘Sunny Day’”
- “Import my playlist”
- “Next song”
- “Pause”
- “Shuffle play”
- “Set volume to 50%”
The agent will call the music tool to control the player.
Configuring the Default Playlist¶
If you want the player to load a fixed playlist at startup, you can set:
set DSH_MUSIC_PLAYLIST=13060319975
dsh --profile web
If not set, the playlist is empty; after opening the player, you can manually import.
Optional: Login State and Stable Playback¶
By default with anonymous parsing, Netease returns the full song for free songs, but only 30 seconds for restricted/VIP songs. Anonymous parsing relies on third-party Meting services; restricted songs may fail. If stable playback of VIP full songs is needed, it is recommended to use a self-built cloud proxy.
If local login state parsing is needed, you can configure:
set DSH_MUSIC_COOKIE=MUSIC_U=...
dsh --profile web
DSH_MUSIC_COOKIE should contain your local Netease login state (including MUSIC_U). The Cookie is only saved in the local environment variable and will not be uploaded to any third party.
Suitable Scenarios and Notes¶
Suitable for users who need to listen to music while chatting in DSH Web and control playback/queue with natural language.
Please note:
- Songs restricted by copyright/VIP may not be playable.
- This project has no affiliation with DeepSeek or Netease Cloud Music; audio comes from Netease’s public interface and third-party Meting parsing services, for learning and communication purposes only.
- The
musictool and UI operations are completed locally within the DSH instance. - The plugin runs with the permissions of the current
dshprocess; check the source code and license before installing. - Do not publicly spread cloud proxy addresses and tokens.
References¶
- Directory page: https://www.skillhub.cn/plugins/xiekai886/dsh-MusicPlayer
- GitHub: https://github.com/xiekai886/dsh-MusicPlayer