把 acgay 音乐站嵌入 DSH 侧边栏,支持搜索、全局迷你播放器;配置导入 token 后可把站点缺的曲目导入 acgay。它的 HTTP 路由没有 DSH 的访问检查,浏览器里打开的网页可以调用它们。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:fishcg/dsh-music
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness (DSH) plugin that embeds the online acgay.cn music site in a right-side drawer, with an optional import path for missing tracks.
Features
- A small vinyl button in the DSH top-right corner opens a right drawer.
- The drawer preloads behind the scenes and keeps its iframe mounted, so reopening is instant and the acgay login session is preserved.
- The site header, footer and bottom navigation are hidden inside the drawer. Login is available at the top of the drawer.
- Search queries acgay and an online catalog in parallel; acgay results are always listed first.
- Online catalog rows can be imported into acgay, where they are published immediately (
status = 1). - A compact top player controls play/pause, previous/next, progress, and shows the current cover/title.
- The drawer and the surrounding workspace animate open/closed. Clicking outside closes it;
Escalso closes it.
Requirements
- DSH desktop with the profile patched to load this package.
ffmpegandffprobeonPATHfor imports. Search and playback do not need ffmpeg.- Node.js 20+ (the DSH runtime is normally sufficient).
Install
Add the package to the DSH profile and patch the profile:
// ~/.dsh/profiles/desktop/package.json
{
"dependencies": {
"dsh-music": "link:/absolute/path/to/dsh-music"
},
"dsh": {
"profile": {
"bundles": ["dsh-music"]
}
}
}
# ~/.dsh/profiles/desktop/cordis.patch.yml
- insert:
- id: dsh-music
name: 'dsh-music'
Reload DSH after adding the package. If the client half does not appear on an already-running app, restart DSH once.
Import credential (optional)
Import is disabled when no credential is configured. Search, playback, login, and the mini player still work.
The host resolves the token in this order:
ACGAY_IMPORT_TOKENenvironment variable.config.importToken/config.tokenin the plugin row.ACGAY_IMPORT_TOKEN_FILEenvironment variable (path to a file).~/.acgay-import-token.~/.dsh/profiles/desktop/acgay-import-token(legacy location).
The file contains the raw token, one line. Import is enabled when a non-empty token is found.
When no token is set:
/dsh-music/statereturnsimports: false.- Per-row import buttons and the “抓取并入库” action are hidden.
- A direct POST to
/dsh-music/importreturns HTTP 503.
Do not commit the token. It is a shared write credential for the acgay import endpoint.
Optional environment variables
| Variable | Default | Purpose |
|---|---|---|
ACGAY_BASE_URL |
https://www.acgay.cn |
Upstream site used by the proxy and the importer. |
ACGAY_IMPORT_TOKEN |
unset | Enables import. |
ACGAY_IMPORT_TOKEN_FILE |
unset | Read the token from a custom path. |
ACGAY_FFMPEG |
ffmpeg |
ffmpeg executable. |
ACGAY_FFPROBE |
ffprobe |
ffprobe executable. |
DSH_ACGAY_NODE_BIN |
process.execPath |
Node executable used for the import worker. |
How import works
- The client asks acgay for online catalog candidates along with the normal site search.
- Clicking “导入”, or “抓取并入库”, calls the plugin host route
POST /dsh-music/importwith{ query }; a catalog item id may be sent instead. - The host starts
scripts/import-one.mjsas a short-lived child process. scripts/import-direct.mjsselects one candidate, downloads it, converts it to 192 kbps mp3 with ffmpeg, and POSTs a multipart request to acgay’s/api/plugin/importwith the token.- acgay writes the audio/cover to OSS, inserts a published
lab_musicrow and anlab_import_logrow, and returns the production id. The drawer navigates to/sound/{id}.
Nothing is written to a local MySQL database or local OSS client.
Security notes
- The shared import token grants upload + auto-publish permission. Never ship it in a public repository or client bundle.
- The embedded acgay login session is kept in
~/.dsh/dsh-music-cookies.json(mode 0600) by the loopback proxy, so a DSH restart does not force a new acgay login. It contains a session cookie, not a password. Delete the file to drop the saved session locally; the acgay session expiry still applies server-side. - A shared token should only be used in a trusted self-hosted setup. For multi-user deployments, use per-user tokens or a rate-limited endpoint.
- The plugin performs no database, OSS, or catalog account authentication itself; all privileged writes happen in the acgay server endpoint.
Development
index.js: DSH host half; proxy, state, import route.client.js: DSH web client half; vinyl button, drawer, search panel, mini player.assets/bridge.js: injected into proxied pages; forwardswindow.__ACGAY_PLAYER__state and commands.scripts/import-direct.ts: source for the importer.scripts/import-direct.mjs: runtime bundle (generated from the TS source).scripts/lib/*.ts/*.mjs: vendored catalog client used by the importer.
License
MIT
链接
同类插件
PC2005-cloud/dsh-pet#dsh-pet★ 6367
DSH Web UI 桌面宠物,Windows / macOS / Linux 三端可用:浏览器浮层或透明置顶桌面窗口,106 个透明动画、带挤压与粒子的甩抛反弹物理、随会话事件实时联动的工作状态气泡、碎碎念与带持久记忆的对话、余额展示、表情包配图、多开同屏,并支持直接放入的自定义动画与宠物种类(pet pack)。
flizzywine/dsh-tavern#dsh-tavern★ 1636
基于 DeepSeek Harness 的 Agent 酒馆,兼容 SillyTavern 生态,人物卡导入即玩,支持多种模型和手机游玩。桌面端从「设置 → 酒馆启动器」安装酒馆。 基于 2NF/dsh-profile-bridge(MIT)改造的启动器:把酒馆下载到独立 DSH 配置并在重启时切换。与上游插件不能同装——两者都占用 /profile-bridge 通道。
Alterssss/dsh-bili-whale★ 1062
一条按自己作息过日子的 B 站插件:宿主里每 60 秒一次心跳,在设定的作息窗口里随机挑一个时刻叫醒专用会话(今天不想看是按概率跳过),再交给自带的 38 个子命令——信息流、字幕、弹幕、评论、ffmpeg 抽帧、两本日记。每天最多发 N 条评论/动态并 @ 主人(默认 3,按配额账本计数,撞到限流或验证码就停手)。同时轮询评论回复、私信和直播间弹幕;除主人以外的回复先入队,等主人在设置页批准。设置 → 养鱼 写 ~/.dsh/bili-whale.config.json;cookie 单独在 ~/.bili-ai/credentials.json,只写不回显。HTTP 路由只认回环地址并过 DSH 信任栅栏。抽帧需要 Node 18+ 与 ffmpeg。
Nagi-ovo/dsh-ads★ 728
2005 年中文站点风格的整活广告插件:侧栏广告/信息流/角落弹窗 + 假关闭叉,素材全虚构。
yyh-001/dsh-meme★ 581
聊天表情包:纯文本斗图、情绪主动发图、像 QQ/微信 一样发图、AI 自动学图、自定义表情包。
vlln/whale-girl★ 409
桌面宠物(QQ 宠物形态):右下角悬浮、可拖拽/投喂/玩耍。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。