MeowMusic YouTube MP3
Use this skill to rebuild the currently working MeowMusicServer-patched solution into another repo/server without rediscovering the whole stack.
Workflow decision tree
- 1. Need cookie sync from Windows Chrome to server?
- Use
scripts/youtube_cookie_sync.py.
- If the user wants a double-click workflow on Windows, also use
scripts/windows/sync_cookie.bat and
scripts/windows/open_youtube.bat.
- If you need API shape or server handler details, read
references/cookie-api-and-sync.md.
- 2. Need to prepare a Linux server for YouTube download and MP3 extraction?
- Run
scripts/install_server_env.sh.
- If challenge solving or runtime behavior is flaky, read
references/server-runtime-notes.md.
- 3. Need to patch MeowMusicServer so old sources stay first and YouTube acts only as fallback/补源?
- Read
references/meowmusic-integration.md.
- Keep source priority as:
sources.json → local library → cache → legacy upstreams → YouTube fallback.
- Do
not make YouTube the default first source unless the user explicitly asks.
- 4. Need MV -> MP3 instead of direct streaming?
- Prefer
yt-dlp to fetch bestaudio, then use
ffmpeg to normalize/transcode into a stable cached
music.mp3.
- Read
references/meowmusic-integration.md for the patch pattern and command shape.
Core operating rules
- - Prefer old/legacy music sources first. YouTube is a补源/fallback path, not the primary path.
- Prefer local reusable cache/library over repeated redownloads.
- Prefer returning a stable cached
music.mp3 path to devices instead of a fragile live stream. - If a cookie file exists, pass it to
yt-dlp automatically. - When YouTube requires extra handling, prefer extractor args compatible with the known-good setup:
-
youtube:player_client=tv,web;formats=missing_pot
-
youtube:player_skip=webpage,configs
- - Keep all cookie and bearer-token material out of the skill package. Use placeholders only.
Recommended implementation shape
1. Windows cookie sync
On Windows, export cookies from Chrome with:
CODEBLOCK0
Then POST the cookie file content to a server endpoint such as:
- - INLINECODE16
- optional status check: INLINECODE17
Use scripts/youtube_cookie_sync.py unless the repo already has its own equivalent.
2. Server download strategy
Use this shape:
- 1. Search top YouTube MV/result for a song.
- Download audio with
yt-dlp into a per-track cache directory. - Convert the downloaded source into
music.mp3 with ffmpeg. - Return cached local URLs from the service.
3. MeowMusic source order
Use this order unless the user asks otherwise:
- 1. curated INLINECODE22
- local uploaded/downloaded library
- existing cache hits
- legacy remote music APIs
- YouTube fallback
This keeps the product aligned with the current direction: local-first, old-source-first, YouTube only for missing tracks.
Files in this skill
- -
scripts/install_server_env.sh — server bootstrap for Node 22, yt-dlp, yt-dlp-ejs, ffmpeg. - INLINECODE24 — export Chrome/Edge/Firefox cookies and push them to the server.
- INLINECODE25 — Windows double-click wrapper.
- INLINECODE26 — helper to open YouTube in Chrome.
- INLINECODE27 — cookie API contract and usage notes.
- INLINECODE28 — server environment and challenge-solver notes.
- INLINECODE29 — patch strategy and concrete Go snippets.
Execution notes
- - Read only the reference file relevant to the current task.
- When editing an existing repo, prefer minimal surgical patches over broad rewrites.
- When a download path already works, preserve behavior and only harden the flaky parts.
- If the target repo differs from MeowMusicServer, reuse the flow, not the exact filenames.
MeowMusic YouTube MP3
使用此技能将当前正常运行的 MeowMusicServer-patched 解决方案重建到另一个仓库/服务器中,而无需重新发现整个技术栈。
工作流程决策树
- 1. 需要从 Windows Chrome 同步 Cookie 到服务器?
- 使用 scripts/youtube
cookiesync.py。
- 如果用户希望在 Windows 上使用双击工作流,还需使用 scripts/windows/sync
cookie.bat 和 scripts/windows/openyoutube.bat。
- 如果需要了解 API 结构或服务器处理程序细节,请阅读 references/cookie-api-and-sync.md。
- 2. 需要为 YouTube 下载和 MP3 提取准备 Linux 服务器?
- 运行 scripts/install
serverenv.sh。
- 如果遇到挑战解决或运行时行为不稳定,请阅读 references/server-runtime-notes.md。
- 3. 需要修补 MeowMusicServer 以保持旧源优先,YouTube 仅作为回退/补源?
- 阅读 references/meowmusic-integration.md。
- 保持源优先级为:sources.json → 本地库 → 缓存 → 旧版上游 → YouTube 回退。
-
不要将 YouTube 设为默认首选源,除非用户明确要求。
- 4. 需要 MV -> MP3 而非直接流式传输?
- 优先使用 yt-dlp 获取最佳音频,然后使用 ffmpeg 进行归一化/转码,生成稳定的缓存 music.mp3。
- 阅读 references/meowmusic-integration.md 了解补丁模式和命令格式。
核心操作规则
- - 优先使用旧版/传统音乐源。YouTube 是补源/回退路径,而非主要路径。
- 优先使用本地可复用缓存/库,而非重复下载。
- 优先向设备返回稳定的缓存 music.mp3 路径,而非不稳定的实时流。
- 如果存在 Cookie 文件,自动将其传递给 yt-dlp。
- 当 YouTube 需要额外处理时,优先使用与已知良好配置兼容的提取器参数:
- youtube:player
client=tv,web;formats=missingpot
- youtube:player_skip=webpage,configs
- - 将所有 Cookie 和 Bearer Token 材料排除在技能包之外。仅使用占位符。
推荐实现结构
1. Windows Cookie 同步
在 Windows 上,使用以下命令从 Chrome 导出 Cookie:
bash
yt-dlp --cookies-from-browser chrome:Default --cookies youtube-cookies.txt --skip-download https://www.youtube.com/watch?v=dQw4w9WgXcQ
然后将 Cookie 文件内容 POST 到服务器端点,例如:
- - POST /api/admin/youtube-cookie/update
- 可选状态检查:GET /api/admin/youtube-cookie/status
除非仓库已有等效功能,否则使用 scripts/youtubecookiesync.py。
2. 服务器下载策略
使用以下结构:
- 1. 搜索歌曲的顶部 YouTube MV/结果。
- 使用 yt-dlp 将音频下载到每首曲目的缓存目录。
- 使用 ffmpeg 将下载的源文件转换为 music.mp3。
- 从服务返回缓存的本地 URL。
3. MeowMusic 源顺序
除非用户另有要求,否则使用以下顺序:
- 1. 精选的 sources.json
- 本地上传/下载的库
- 现有缓存命中
- 旧版远程音乐 API
- YouTube 回退
这使产品与当前方向保持一致:本地优先、旧源优先,YouTube 仅用于缺失曲目。
此技能中的文件
- - scripts/installserverenv.sh — 用于 Node 22、yt-dlp、yt-dlp-ejs、ffmpeg 的服务器引导脚本。
- scripts/youtubecookiesync.py — 导出 Chrome/Edge/Firefox Cookie 并将其推送到服务器。
- scripts/windows/synccookie.bat — Windows 双击包装器。
- scripts/windows/openyoutube.bat — 在 Chrome 中打开 YouTube 的辅助脚本。
- references/cookie-api-and-sync.md — Cookie API 合同和使用说明。
- references/server-runtime-notes.md — 服务器环境和挑战解决器说明。
- references/meowmusic-integration.md — 补丁策略和具体 Go 代码片段。
执行说明
- - 仅阅读与当前任务相关的参考文件。
- 编辑现有仓库时,优先进行最小化的精确修补,而非大规模重写。
- 当下载路径已正常工作时,保留行为,仅加固不稳定的部分。
- 如果目标仓库与 MeowMusicServer 不同,复用流程而非具体文件名。