🎨 极致美学
|
⚡ 卓越性能
|
告别乱码和封面缺失!MelodyHub 独创多源元数据聚合引擎:
docker run -d \
--name melodyhub \
-p 80:80 \
-v ./downloads:/app/downloads \
-v ./data:/app/data \
-v ./music-api-scripts:/app/music-api/uploads/scripts \
-e DOWNLOAD_API_PASSWORD=your_secure_password \
--restart unless-stopped \
spf20081/melodyhub:latest
创建 docker-compose.yml:
version: '3.8'
services:
melodyhub:
image: spf20081/melodyhub:latest
container_name: MelodyHub
ports:
- "80:80"
volumes:
- ./downloads:/app/downloads
- ./data:/app/data
- ./music-api-scripts:/app/music-api/uploads/scripts
environment:
- DOWNLOAD_API_PASSWORD=your_secure_password
restart: unless-stopped
启动服务:
docker-compose up -d
# 克隆项目
git clone https://github.com/spfnas/MelodyHub.git
cd MelodyHub
# 安装依赖
npm install
# 启动开发服务器
npm run serve
# 构建生产版本
npm run build
MelodyHub/
├── 📂 downloads/ # 下载的音乐文件
├── 📂 data/ # 用户数据和配置
├── 📂 music-api-scripts/ # 自定义音源脚本
├── 📂 src/ # 前端源代码
│ ├── 📂 components/ # Vue 组件
│ ├── 📂 views/ # 页面视图
│ ├── 📂 utils/ # 工具函数
│ └── 📂 assets/ # 静态资源
├── 📂 music-api/ # LX 音源解析 API
│ ├── 📂 src/
│ │ ├── 📂 routes/ # API 路由
│ │ └── 📂 utils/ # 工具函数
│ └── 📂 uploads/scripts/ # 上传的脚本
└── 📂 server/ # 下载服务器
GET /music-api/api/music/sources
响应示例:
{
"code": 200,
"data": {
"sources": ["kw", "kg", "mg"],
"scripts": ["custom_script_1", "custom_script_2"]
}
}
GET /music-api/api/music/search
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| keyword | string | ✅ | 搜索关键词 |
| source | string | ✅ | 音源 (kw/kg/mg) |
| page | number | ❌ | 页码 (默认 1) |
| limit | number | ❌ | 每页数量 (默认 30) |
响应示例:
{
"code": 200,
"data": {
"list": [
{
"name": "歌曲名",
"singer": "歌手",
"songmid": "歌曲ID",
"albumName": "专辑名"
}
],
"total": 100
}
}
GET /music-api/api/music/url/{source}/{songmid}?quality={quality}
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| source | string | ✅ | 音源标识 |
| songmid | string | ✅ | 歌曲 ID |
| quality | string | ❌ | 音质 (128k/320k/flac) |
POST /music-api/api/scripts/upload
Content-Type: multipart/form-data
参数:
script: 脚本文件 (.js)id: 脚本 ID (可选)GET /music-api/api/scripts/list
DELETE /music-api/api/scripts/{id}
| 变量名 | 默认值 | 说明 |
|---|---|---|
DOWNLOAD_API_PASSWORD | - | 下载 API 访问密码 (强烈建议设置) |
DOWNLOAD_DIR | /app/downloads | 音乐文件存储路径 |
DATA_DIR | /app/data | 用户数据存储路径 |
PORT | 80 | 服务监听端口 |
| 卷路径 | 说明 | 建议 |
|---|---|---|
/app/downloads | 下载的音乐文件 | 映射到大容量存储 |
/app/data | 用户数据和配置 | 定期备份 |
/app/music-api/uploads/scripts | 自定义脚本 | 可选映射 |
/music-api).js 脚本文件downloads 目录✨ 新增
🎨 优化
⚡ 性能
🔧 修复
✨ 新增
✨ 新增
# 开发环境
npm run serve
# 生产构建
npm run build
# 代码格式化
npm run prettier
# Lint 检查
npm run lint
# Docker 构建
docker build -t melodyhub:custom .
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)我们欢迎所有形式的贡献!无论是:
请查看 贡献指南 了解更多信息。
特别感谢以下开源项目:
重要提示
本项目仅供个人学习研究使用,请勿用于商业用途。
请尊重音乐版权,支持正版音乐。本项目不提供任何音乐资源,所有音乐来源于第三方平台。
本项目基于 MIT License 开源。
MIT License
Copyright (c) 2026 MelodyHub Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
Content type
Image
Digest
sha256:71272b002…
Size
102.6 MB
Last updated
8 months ago
docker pull spf20081/melodyhub