Files
am-downloader/README.md
T

76 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AM Downloader
独立的音乐搜索与下载 Web 服务,使用 AM 音乐 API 解析资源,并可选同步到 WebDAV/NAS。
## 特性
- 音乐搜索与分页
- 下载队列、去重、失败重试
- 自动识别实际音频格式,避免错误扩展名
- 标记解析后的音质与实际音质
- WebDAV/NAS 同步
- 可配置同曲低音质版本清理策略
- 可配置上传成功后的本地文件清理策略
- Docker Compose 部署
## 架构
`9540` 提供 Downloader Web/API;音乐解析服务通过配置的 `AM_API_URL` 访问,默认指向本机 `9530`。
运行时数据库和下载文件不会进入 Git 仓库。
## 快速部署
```bash
git clone <your-gitea-repository>
cd am-downloader
docker compose up -d --build
```
默认访问:`http://127.0.0.1:9540`
## 配置
Docker Compose 中只保存非敏感的运行参数。WebDAV 凭据通过 Web UI 的设置页面写入运行时数据库,**不要将数据库提交到 Git**。
可配置:
- `PORT`:Web 服务端口,默认 `9540`
- `DB_PATH`:SQLite 数据库路径
- `DOWNLOAD_DIR`:下载目录
- `AM_API_URL`:AM 音乐 API 地址
- `WORKERS`:下载 worker 数量
首次部署后进入设置页面填写 WebDAV 地址、用户名、密码和远程目录。
## 数据与安全
以下内容属于运行时数据,默认被 `.gitignore` 排除:
- `data/`
- `downloads/`
- `*.db`
- 日志、临时文件和本地环境文件
提交前应检查 Git diff,确认没有密码、Token、Cookie、私有密钥或个人环境配置。
## 开发
```bash
go test ./...
go build -o am-downloader .
```
前端为单页静态界面,由 Go 服务直接提供。
## API
- `GET /api/search`
- `GET /api/tasks`
- `POST /api/tasks`
- `POST /api/tasks/:id/retry`
- `DELETE /api/tasks/:id`
- `GET /api/settings`
- `PUT /api/settings`
- `POST /api/webdav/test`