Compare commits
27 Commits
4ea05279bd
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6474cf8b4e | ||
|
|
54d97beb15 | ||
|
|
99d71f05cf | ||
|
|
87aa994365 | ||
|
|
e6a8f62bba | ||
|
|
83f385edb2 | ||
|
|
932826aeca | ||
|
|
9b737012e9 | ||
|
|
4bdb5c539d | ||
|
|
6b1cdb92ad | ||
|
|
a76ef33c4c | ||
|
|
c9fac4b7fe | ||
|
|
79595dc9ed | ||
|
|
58ac7ec198 | ||
|
|
ae5e34694e | ||
|
|
0ff4769eb0 | ||
|
|
ad972dd2a5 | ||
|
|
c07c4e42e6 | ||
|
|
ef44218198 | ||
|
|
1f8d392114 | ||
|
|
44ff76d58d | ||
|
|
b5b093e64b | ||
|
|
5561bf2400 | ||
|
|
c6fb745b85 | ||
|
|
a2a366d34a | ||
|
|
50f7869a05 | ||
|
|
89a28e1bc5 |
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
node_modules
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
data
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.DS_Store
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
131
CLAUDE.md
Normal file
131
CLAUDE.md
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## 项目概述
|
||||||
|
|
||||||
|
没事Music 是一个基于 Web 的音乐播放器应用,采用单文件 React 架构,支持多平台音乐搜索、播放和同步功能。
|
||||||
|
|
||||||
|
## 架构设计
|
||||||
|
|
||||||
|
### 前端架构 (index.html)
|
||||||
|
|
||||||
|
**单文件应用模式**:
|
||||||
|
- 所有前端代码集中在 `index.html` (~89KB)
|
||||||
|
- 使用 Babel Standalone 在浏览器端编译 JSX
|
||||||
|
- React 18 + Tailwind CSS + Font Awesome (均通过 CDN 引入)
|
||||||
|
|
||||||
|
**核心组件结构**:
|
||||||
|
```
|
||||||
|
App (主容器)
|
||||||
|
├── SideDrawer (侧边栏设置)
|
||||||
|
├── MiniPlayer (迷你播放器)
|
||||||
|
├── FullPlayer (全屏播放器)
|
||||||
|
├── PlaylistDrawer (播放列表)
|
||||||
|
└── TopListPage (排行榜页面)
|
||||||
|
```
|
||||||
|
|
||||||
|
**状态管理**:
|
||||||
|
- 使用 React Hooks (useState, useEffect, useRef, useMemo, useCallback)
|
||||||
|
- 数据持久化: localStorage (前缀 `th_`)
|
||||||
|
- 关键状态: playlist, favorites, currentSong, syncToken, syncMode
|
||||||
|
|
||||||
|
**数据规范化**:
|
||||||
|
- `normalizeSongId()`: 全局强制歌曲 ID 为字符串类型
|
||||||
|
- `normalizeSongList()`: 批量规范化歌曲列表
|
||||||
|
- `getSongDurationSeconds()`: 统一处理不同来源的时长字段 (duration/dt/time/interval/length/playTime)
|
||||||
|
|
||||||
|
### 后端架构 (sync-server/server.js)
|
||||||
|
|
||||||
|
**KV 存储服务**:
|
||||||
|
- 基于 Node.js 原生 HTTP 服务器
|
||||||
|
- 文件系统存储: `data/{token}_{key}.json`
|
||||||
|
- API 端点: `GET/POST /kv/:key?token=...`
|
||||||
|
- Token 用于用户隔离
|
||||||
|
|
||||||
|
**后台下载管理器**:
|
||||||
|
- 自动检测歌曲列表数据并触发下载
|
||||||
|
- 文件命名: `{歌手} - {歌名} [{平台}_{ID}]`
|
||||||
|
- 文件名清理: Unicode 规范化 (NFC) + 非法字符替换
|
||||||
|
- 存储路径: `MUSIC_DIR` (默认 `./music`)
|
||||||
|
|
||||||
|
### 同步策略
|
||||||
|
|
||||||
|
**两种同步模式**:
|
||||||
|
1. **私有云同步** (`syncMode: 'server'`):
|
||||||
|
- 基于 Token 的 KV 存储
|
||||||
|
- 增量同步: 计算本地与上次同步的差异 (added/removed)
|
||||||
|
- 自动同步: 每 15 分钟执行一次
|
||||||
|
|
||||||
|
2. **网易云歌单同步** (`syncMode: 'netease_playlist'`):
|
||||||
|
- 通过 TuneHub API 获取歌单
|
||||||
|
- 导入即替换逻辑
|
||||||
|
- 自动同步: 每 15 分钟执行一次
|
||||||
|
|
||||||
|
**同步流程**:
|
||||||
|
```
|
||||||
|
拉取远程 → 计算差异 → 合并本地(非覆盖) → 推送至私有云
|
||||||
|
```
|
||||||
|
|
||||||
|
### 外部 API 集成
|
||||||
|
|
||||||
|
**TuneHub API** (https://music-dl.sayqz.com):
|
||||||
|
- 搜索: `/api/?type=search&keyword=...&source=...`
|
||||||
|
- 歌词: `/api/?source=...&id=...&type=lrc`
|
||||||
|
- 排行榜列表: `/api/?source=...&type=toplists`
|
||||||
|
- 排行榜歌曲: `/api/?source=...&id=...&type=toplist`
|
||||||
|
- 歌单详情: `/api/?type=playlist&id=...&source=...`
|
||||||
|
|
||||||
|
**支持平台**: netease, kuwo, qq, kugou
|
||||||
|
|
||||||
|
## 部署架构
|
||||||
|
|
||||||
|
### Docker Compose
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
music-canvas: # 前端静态网站
|
||||||
|
ports: 7481:3000
|
||||||
|
|
||||||
|
sync-service: # 同步服务
|
||||||
|
ports: 7482:3001
|
||||||
|
volumes:
|
||||||
|
- ./data:/app/data # KV 数据存储
|
||||||
|
- ./music:/app/music # 音乐文件存储
|
||||||
|
```
|
||||||
|
|
||||||
|
### Nginx 配置
|
||||||
|
|
||||||
|
- 前端: `/` → `http://127.0.0.1:7481`
|
||||||
|
- 同步 API: `/api/` → `http://127.0.0.1:7482/` (去掉 `/api` 前缀)
|
||||||
|
|
||||||
|
## 开发注意事项
|
||||||
|
|
||||||
|
### 代码修改原则
|
||||||
|
|
||||||
|
1. **ID 类型一致性**: 所有歌曲 ID 必须保持字符串类型,使用 `normalizeSongId()` 处理
|
||||||
|
2. **文件名清理**: 使用 Unicode NFC 规范化 + 非法字符替换,避免跨平台问题
|
||||||
|
3. **状态同步**: 修改 favorites/playlist 后,确保同步逻辑正确触发
|
||||||
|
4. **API 调用**: 所有外部 API 调用通过 TuneHub API,不要直接调用各平台 API
|
||||||
|
|
||||||
|
### 关键常量
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
API_BASE = "https://music-dl.sayqz.com"
|
||||||
|
SYNC_API_BASE = "/api" // 相对路径,依赖 Nginx 代理
|
||||||
|
SOURCES = ['netease', 'kuwo', 'qq', 'kugou']
|
||||||
|
```
|
||||||
|
|
||||||
|
### 本地开发
|
||||||
|
|
||||||
|
前端无需构建,直接用浏览器打开 `index.html` 即可。如需测试同步功能:
|
||||||
|
```bash
|
||||||
|
cd sync-server
|
||||||
|
node server.js # 默认端口 3001
|
||||||
|
```
|
||||||
|
|
||||||
|
### 环境变量 (sync-server)
|
||||||
|
|
||||||
|
- `DATA_DIR`: KV 数据存储目录 (默认 `./data`)
|
||||||
|
- `MUSIC_DIR`: 音乐文件存储目录 (默认 `./music`)
|
||||||
|
- `PORT`: 服务端口 (默认 `3001`)
|
||||||
8
Netease-sync/.dockerignore
Normal file
8
Netease-sync/.dockerignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
README.md
|
||||||
|
需求.md
|
||||||
|
.env
|
||||||
|
data
|
||||||
18
Netease-sync/Dockerfile
Normal file
18
Netease-sync/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
# Install FFmpeg for audio processing
|
||||||
|
RUN apk add --no-cache ffmpeg
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
RUN npm install --production
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["node", "server.js"]
|
||||||
150
Netease-sync/README.md
Normal file
150
Netease-sync/README.md
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
# Netease Sync to Navidrome
|
||||||
|
|
||||||
|
将网易云音乐歌单同步到 Navidrome 的服务。
|
||||||
|
|
||||||
|
## 功能特性
|
||||||
|
|
||||||
|
- 支持通过歌单ID或分享链接添加网易云音乐歌单
|
||||||
|
- 自动下载歌单中的歌曲(通过 sync-server)
|
||||||
|
- 在 Navidrome 中创建同名歌单
|
||||||
|
- 自动匹配并添加已下载的歌曲到 Navidrome 歌单
|
||||||
|
- 定时自动同步(默认每300秒)
|
||||||
|
- 增量同步,只添加新歌曲
|
||||||
|
- 实时同步状态反馈
|
||||||
|
- Web 界面管理
|
||||||
|
|
||||||
|
## 环境变量
|
||||||
|
|
||||||
|
在启动服务前,需要配置以下环境变量:
|
||||||
|
|
||||||
|
| 变量名 | 说明 | 默认值 |
|
||||||
|
|--------|------|--------|
|
||||||
|
| `PORT` | 服务端口 | 3000 |
|
||||||
|
| `DATA_DIR` | 数据存储目录 | /app/data |
|
||||||
|
| `NAVIDROME_URL` | Navidrome 服务地址 | http://navidrome:4533 |
|
||||||
|
| `NAVIDROME_USERNAME` | Navidrome 用户名 | admin |
|
||||||
|
| `NAVIDROME_PASSWORD` | Navidrome 密码 | - |
|
||||||
|
| `SYNC_INTERVAL` | 定时同步间隔(秒) | 300 |
|
||||||
|
| `SYNC_SERVER_URL` | Sync-Server 服务地址 | http://sync-service:3001 |
|
||||||
|
| `SYNC_SERVER_TOKEN` | Sync-Server 认证令牌 | default |
|
||||||
|
| `TUNEHUB_API_URL` | TuneHub API 地址 | https://music-dl.sayqz.com |
|
||||||
|
|
||||||
|
## 使用方法
|
||||||
|
|
||||||
|
### 1. 配置环境变量
|
||||||
|
|
||||||
|
复制 `.env.example` 为 `.env` 并修改配置:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
编辑 `.env` 文件,设置 Navidrome 的连接信息。
|
||||||
|
|
||||||
|
### 2. 使用 Docker Compose 启动
|
||||||
|
|
||||||
|
在项目根目录运行:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d netease-sync
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 访问 Web 界面
|
||||||
|
|
||||||
|
打开浏览器访问:`http://localhost:7483`
|
||||||
|
|
||||||
|
### 4. 添加歌单
|
||||||
|
|
||||||
|
在输入框中输入网易云音乐歌单ID或分享链接,例如:
|
||||||
|
- 歌单ID:`123456789`
|
||||||
|
- 分享链接:`https://music.163.com/#/playlist?id=123456789`
|
||||||
|
|
||||||
|
点击"添加歌单"按钮,系统会自动:
|
||||||
|
1. 获取歌单信息
|
||||||
|
2. 下载所有歌曲
|
||||||
|
3. 在 Navidrome 中创建歌单
|
||||||
|
4. 添加歌曲到歌单
|
||||||
|
|
||||||
|
### 5. 管理歌单
|
||||||
|
|
||||||
|
- **立即同步**:点击"立即同步"按钮手动触发同步
|
||||||
|
- **删除歌单**:点击"删除"按钮移除歌单(不会删除 Navidrome 中的歌单)
|
||||||
|
- **查看状态**:实时查看同步状态和上次同步时间
|
||||||
|
|
||||||
|
## API 接口
|
||||||
|
|
||||||
|
### 获取所有歌单
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /api/playlists
|
||||||
|
```
|
||||||
|
|
||||||
|
### 添加歌单
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /api/playlists
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{
|
||||||
|
"url": "歌单ID或分享链接"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 删除歌单
|
||||||
|
|
||||||
|
```
|
||||||
|
DELETE /api/playlists/:id
|
||||||
|
```
|
||||||
|
|
||||||
|
### 手动同步歌单
|
||||||
|
|
||||||
|
```
|
||||||
|
POST /api/playlists/:id/sync
|
||||||
|
```
|
||||||
|
|
||||||
|
### 获取歌单状态
|
||||||
|
|
||||||
|
```
|
||||||
|
GET /api/status/:id
|
||||||
|
```
|
||||||
|
|
||||||
|
## 同步逻辑
|
||||||
|
|
||||||
|
1. **获取歌单信息**:通过 TuneHub API 获取网易云音乐歌单信息
|
||||||
|
2. **下载歌曲**:将歌曲列表发送到 sync-server 进行下载
|
||||||
|
3. **等待下载完成**:等待 5 秒让 sync-server 处理下载
|
||||||
|
4. **匹配歌曲**:根据文件名格式 `Artist - Name [netease_id].ext` 在 Navidrome 中搜索歌曲
|
||||||
|
5. **更新歌单**:
|
||||||
|
- 如果是首次同步,在 Navidrome 中创建新歌单
|
||||||
|
- 如果已存在,只添加新匹配到的歌曲
|
||||||
|
6. **记录映射**:保存网易云音乐歌曲ID到 Navidrome歌曲ID的映射关系
|
||||||
|
|
||||||
|
## 数据存储
|
||||||
|
|
||||||
|
所有数据存储在 `DATA_DIR` 目录下的 `playlists.json` 文件中,包括:
|
||||||
|
- 歌单信息
|
||||||
|
- Navidrome 歌单ID
|
||||||
|
- 歌曲映射关系
|
||||||
|
- 同步状态和时间
|
||||||
|
|
||||||
|
## 故障排除
|
||||||
|
|
||||||
|
### 歌单同步失败
|
||||||
|
|
||||||
|
1. 检查 Navidrome 连接配置是否正确
|
||||||
|
2. 查看 Docker 容器日志:`docker logs netease-sync`
|
||||||
|
3. 确认 sync-server 正常运行
|
||||||
|
4. 检查网络连接
|
||||||
|
|
||||||
|
### 歌曲未匹配到
|
||||||
|
|
||||||
|
1. 确认歌曲已成功下载到 music 目录
|
||||||
|
2. 检查文件名格式是否正确
|
||||||
|
3. Navidrome 可能需要时间扫描新文件
|
||||||
|
4. 尝试手动触发 Navidrome 媒体库扫描
|
||||||
|
|
||||||
|
### 定时同步不工作
|
||||||
|
|
||||||
|
1. 检查 `SYNC_INTERVAL` 环境变量设置
|
||||||
|
2. 查看容器日志确认定时任务是否启动
|
||||||
|
3. 确认服务正常运行
|
||||||
976
Netease-sync/package-lock.json
generated
Normal file
976
Netease-sync/package-lock.json
generated
Normal file
@@ -0,0 +1,976 @@
|
|||||||
|
{
|
||||||
|
"name": "netease-sync",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "netease-sync",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^1.6.0",
|
||||||
|
"dotenv": "^17.2.3",
|
||||||
|
"express": "^4.18.2",
|
||||||
|
"node-cron": "^3.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/accepts": {
|
||||||
|
"version": "1.3.8",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/accepts/-/accepts-1.3.8.tgz",
|
||||||
|
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-types": "~2.1.34",
|
||||||
|
"negotiator": "0.6.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/array-flatten": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/asynckit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/axios": {
|
||||||
|
"version": "1.13.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/axios/-/axios-1.13.2.tgz",
|
||||||
|
"integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"follow-redirects": "^1.15.6",
|
||||||
|
"form-data": "^4.0.4",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/body-parser": {
|
||||||
|
"version": "1.20.4",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/body-parser/-/body-parser-1.20.4.tgz",
|
||||||
|
"integrity": "sha512-ZTgYYLMOXY9qKU/57FAo8F+HA2dGX7bqGc71txDRC1rS4frdFI5R7NhluHxH6M0YItAP0sHB4uqAOcYKxO6uGA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"bytes": "~3.1.2",
|
||||||
|
"content-type": "~1.0.5",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "2.0.0",
|
||||||
|
"destroy": "~1.2.0",
|
||||||
|
"http-errors": "~2.0.1",
|
||||||
|
"iconv-lite": "~0.4.24",
|
||||||
|
"on-finished": "~2.4.1",
|
||||||
|
"qs": "~6.14.0",
|
||||||
|
"raw-body": "~2.5.3",
|
||||||
|
"type-is": "~1.6.18",
|
||||||
|
"unpipe": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8",
|
||||||
|
"npm": "1.2.8000 || >= 1.4.16"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/bytes": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/bytes/-/bytes-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/call-bind-apply-helpers": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"function-bind": "^1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/call-bound": {
|
||||||
|
"version": "1.0.4",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/call-bound/-/call-bound-1.0.4.tgz",
|
||||||
|
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind-apply-helpers": "^1.0.2",
|
||||||
|
"get-intrinsic": "^1.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/content-disposition": {
|
||||||
|
"version": "0.5.4",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/content-disposition/-/content-disposition-0.5.4.tgz",
|
||||||
|
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"safe-buffer": "5.2.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/content-type": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/content-type/-/content-type-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookie": {
|
||||||
|
"version": "0.7.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/cookie/-/cookie-0.7.2.tgz",
|
||||||
|
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookie-signature": {
|
||||||
|
"version": "1.0.7",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/cookie-signature/-/cookie-signature-1.0.7.tgz",
|
||||||
|
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/debug": {
|
||||||
|
"version": "2.6.9",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/debug/-/debug-2.6.9.tgz",
|
||||||
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ms": "2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/depd": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/depd/-/depd-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/destroy": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/destroy/-/destroy-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8",
|
||||||
|
"npm": "1.2.8000 || >= 1.4.16"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "17.2.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/dotenv/-/dotenv-17.2.3.tgz",
|
||||||
|
"integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://dotenvx.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/dunder-proto": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind-apply-helpers": "^1.0.1",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"gopd": "^1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ee-first": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/encodeurl": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/encodeurl/-/encodeurl-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-define-property": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-errors": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/es-errors/-/es-errors-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-object-atoms": {
|
||||||
|
"version": "1.1.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||||
|
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/es-set-tostringtag": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"get-intrinsic": "^1.2.6",
|
||||||
|
"has-tostringtag": "^1.0.2",
|
||||||
|
"hasown": "^2.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/escape-html": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/escape-html/-/escape-html-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/etag": {
|
||||||
|
"version": "1.8.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/etag/-/etag-1.8.1.tgz",
|
||||||
|
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/express": {
|
||||||
|
"version": "4.22.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/express/-/express-4.22.1.tgz",
|
||||||
|
"integrity": "sha512-F2X8g9P1X7uCPZMA3MVf9wcTqlyNp7IhH5qPCI0izhaOIYXaW9L535tGA3qmjRzpH+bZczqq7hVKxTR4NWnu+g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"accepts": "~1.3.8",
|
||||||
|
"array-flatten": "1.1.1",
|
||||||
|
"body-parser": "~1.20.3",
|
||||||
|
"content-disposition": "~0.5.4",
|
||||||
|
"content-type": "~1.0.4",
|
||||||
|
"cookie": "~0.7.1",
|
||||||
|
"cookie-signature": "~1.0.6",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "2.0.0",
|
||||||
|
"encodeurl": "~2.0.0",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"etag": "~1.8.1",
|
||||||
|
"finalhandler": "~1.3.1",
|
||||||
|
"fresh": "~0.5.2",
|
||||||
|
"http-errors": "~2.0.0",
|
||||||
|
"merge-descriptors": "1.0.3",
|
||||||
|
"methods": "~1.1.2",
|
||||||
|
"on-finished": "~2.4.1",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"path-to-regexp": "~0.1.12",
|
||||||
|
"proxy-addr": "~2.0.7",
|
||||||
|
"qs": "~6.14.0",
|
||||||
|
"range-parser": "~1.2.1",
|
||||||
|
"safe-buffer": "5.2.1",
|
||||||
|
"send": "~0.19.0",
|
||||||
|
"serve-static": "~1.16.2",
|
||||||
|
"setprototypeof": "1.2.0",
|
||||||
|
"statuses": "~2.0.1",
|
||||||
|
"type-is": "~1.6.18",
|
||||||
|
"utils-merge": "1.0.1",
|
||||||
|
"vary": "~1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/finalhandler": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/finalhandler/-/finalhandler-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"encodeurl": "~2.0.0",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"on-finished": "~2.4.1",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"statuses": "~2.0.2",
|
||||||
|
"unpipe": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/follow-redirects": {
|
||||||
|
"version": "1.15.11",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
||||||
|
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/form-data": {
|
||||||
|
"version": "4.0.5",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/form-data/-/form-data-4.0.5.tgz",
|
||||||
|
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"es-set-tostringtag": "^2.1.0",
|
||||||
|
"hasown": "^2.0.2",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/forwarded": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/fresh": {
|
||||||
|
"version": "0.5.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/fresh/-/fresh-0.5.2.tgz",
|
||||||
|
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/function-bind": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/get-intrinsic": {
|
||||||
|
"version": "1.3.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||||
|
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind-apply-helpers": "^1.0.2",
|
||||||
|
"es-define-property": "^1.0.1",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"es-object-atoms": "^1.1.1",
|
||||||
|
"function-bind": "^1.1.2",
|
||||||
|
"get-proto": "^1.0.1",
|
||||||
|
"gopd": "^1.2.0",
|
||||||
|
"has-symbols": "^1.1.0",
|
||||||
|
"hasown": "^2.0.2",
|
||||||
|
"math-intrinsics": "^1.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/get-proto": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/get-proto/-/get-proto-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"dunder-proto": "^1.0.1",
|
||||||
|
"es-object-atoms": "^1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/gopd": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/gopd/-/gopd-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/has-symbols": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/has-tostringtag": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"has-symbols": "^1.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/hasown": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/hasown/-/hasown-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"function-bind": "^1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/http-errors": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/http-errors/-/http-errors-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"depd": "~2.0.0",
|
||||||
|
"inherits": "~2.0.4",
|
||||||
|
"setprototypeof": "~1.2.0",
|
||||||
|
"statuses": "~2.0.2",
|
||||||
|
"toidentifier": "~1.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/express"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/iconv-lite": {
|
||||||
|
"version": "0.4.24",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||||
|
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/inherits": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/ipaddr.js": {
|
||||||
|
"version": "1.9.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
||||||
|
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/math-intrinsics": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/media-typer": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/media-typer/-/media-typer-0.3.0.tgz",
|
||||||
|
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/merge-descriptors": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/methods": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/methods/-/methods-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime": {
|
||||||
|
"version": "1.6.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/mime/-/mime-1.6.0.tgz",
|
||||||
|
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"mime": "cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/ms": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/ms/-/ms-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/negotiator": {
|
||||||
|
"version": "0.6.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/negotiator/-/negotiator-0.6.3.tgz",
|
||||||
|
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/node-cron": {
|
||||||
|
"version": "3.0.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/node-cron/-/node-cron-3.0.3.tgz",
|
||||||
|
"integrity": "sha512-dOal67//nohNgYWb+nWmg5dkFdIwDm8EpeGYMekPMrngV3637lqnX0lbUcCtgibHTz6SEz7DAIjKvKDFYCnO1A==",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"uuid": "8.3.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/object-inspect": {
|
||||||
|
"version": "1.13.4",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||||
|
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/on-finished": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/on-finished/-/on-finished-2.4.1.tgz",
|
||||||
|
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ee-first": "1.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/parseurl": {
|
||||||
|
"version": "1.3.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
|
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-to-regexp": {
|
||||||
|
"version": "0.1.12",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||||
|
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/proxy-addr": {
|
||||||
|
"version": "2.0.7",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/proxy-addr/-/proxy-addr-2.0.7.tgz",
|
||||||
|
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"forwarded": "0.2.0",
|
||||||
|
"ipaddr.js": "1.9.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/qs": {
|
||||||
|
"version": "6.14.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/qs/-/qs-6.14.1.tgz",
|
||||||
|
"integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==",
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"dependencies": {
|
||||||
|
"side-channel": "^1.1.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/range-parser": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/range-parser/-/range-parser-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/raw-body": {
|
||||||
|
"version": "2.5.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/raw-body/-/raw-body-2.5.3.tgz",
|
||||||
|
"integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"bytes": "~3.1.2",
|
||||||
|
"http-errors": "~2.0.1",
|
||||||
|
"iconv-lite": "~0.4.24",
|
||||||
|
"unpipe": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/safe-buffer": {
|
||||||
|
"version": "5.2.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||||
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "patreon",
|
||||||
|
"url": "https://www.patreon.com/feross"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "consulting",
|
||||||
|
"url": "https://feross.org/support"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/safer-buffer": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/send": {
|
||||||
|
"version": "0.19.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/send/-/send-0.19.2.tgz",
|
||||||
|
"integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"depd": "2.0.0",
|
||||||
|
"destroy": "1.2.0",
|
||||||
|
"encodeurl": "~2.0.0",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"etag": "~1.8.1",
|
||||||
|
"fresh": "~0.5.2",
|
||||||
|
"http-errors": "~2.0.1",
|
||||||
|
"mime": "1.6.0",
|
||||||
|
"ms": "2.1.3",
|
||||||
|
"on-finished": "~2.4.1",
|
||||||
|
"range-parser": "~1.2.1",
|
||||||
|
"statuses": "~2.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/send/node_modules/ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/serve-static": {
|
||||||
|
"version": "1.16.3",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/serve-static/-/serve-static-1.16.3.tgz",
|
||||||
|
"integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"encodeurl": "~2.0.0",
|
||||||
|
"escape-html": "~1.0.3",
|
||||||
|
"parseurl": "~1.3.3",
|
||||||
|
"send": "~0.19.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/setprototypeof": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
|
"node_modules/side-channel": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/side-channel/-/side-channel-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"object-inspect": "^1.13.3",
|
||||||
|
"side-channel-list": "^1.0.0",
|
||||||
|
"side-channel-map": "^1.0.1",
|
||||||
|
"side-channel-weakmap": "^1.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/side-channel-list": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"object-inspect": "^1.13.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/side-channel-map": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bound": "^1.0.2",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"get-intrinsic": "^1.2.5",
|
||||||
|
"object-inspect": "^1.13.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/side-channel-weakmap": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bound": "^1.0.2",
|
||||||
|
"es-errors": "^1.3.0",
|
||||||
|
"get-intrinsic": "^1.2.5",
|
||||||
|
"object-inspect": "^1.13.3",
|
||||||
|
"side-channel-map": "^1.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/statuses": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/statuses/-/statuses-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/toidentifier": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/type-is": {
|
||||||
|
"version": "1.6.18",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/type-is/-/type-is-1.6.18.tgz",
|
||||||
|
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"media-typer": "0.3.0",
|
||||||
|
"mime-types": "~2.1.24"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/unpipe": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/unpipe/-/unpipe-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/utils-merge": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/uuid": {
|
||||||
|
"version": "8.3.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/uuid/-/uuid-8.3.2.tgz",
|
||||||
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"uuid": "dist/bin/uuid"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/vary": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://mirrors.cloud.tencent.com/npm/vary/-/vary-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
Netease-sync/package.json
Normal file
18
Netease-sync/package.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"name": "netease-sync",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Sync Netease playlists to Navidrome",
|
||||||
|
"main": "server.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node server.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"axios": "^1.6.0",
|
||||||
|
"dotenv": "^17.2.3",
|
||||||
|
"express": "^4.18.2",
|
||||||
|
"node-cron": "^3.0.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
304
Netease-sync/public/app.js
Normal file
304
Netease-sync/public/app.js
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
const API_BASE = '/api';
|
||||||
|
|
||||||
|
let playlists = [];
|
||||||
|
let pollingInterval = null;
|
||||||
|
|
||||||
|
// Toast Notification System
|
||||||
|
function showToast(message, type = 'info') {
|
||||||
|
const container = document.getElementById('toast-container');
|
||||||
|
const toast = document.createElement('div');
|
||||||
|
|
||||||
|
const colors = {
|
||||||
|
info: 'bg-blue-500/80 border-blue-500/50',
|
||||||
|
success: 'bg-green-500/80 border-green-500/50',
|
||||||
|
error: 'bg-red-500/80 border-red-500/50',
|
||||||
|
warning: 'bg-yellow-500/80 border-yellow-500/50'
|
||||||
|
};
|
||||||
|
|
||||||
|
const icons = {
|
||||||
|
info: 'fa-circle-info',
|
||||||
|
success: 'fa-circle-check',
|
||||||
|
error: 'fa-circle-exclamation',
|
||||||
|
warning: 'fa-triangle-exclamation'
|
||||||
|
};
|
||||||
|
|
||||||
|
toast.className = `glass-panel ${colors[type] || colors.info} border text-white px-4 py-3 rounded-xl flex items-center gap-3 shadow-xl transform transition-all duration-300 translate-x-full opacity-0`;
|
||||||
|
toast.innerHTML = `
|
||||||
|
<i class="fa-solid ${icons[type] || icons.info}"></i>
|
||||||
|
<span class="text-sm font-medium">${message}</span>
|
||||||
|
`;
|
||||||
|
|
||||||
|
container.appendChild(toast);
|
||||||
|
|
||||||
|
// Animation in
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
toast.classList.remove('translate-x-full', 'opacity-0');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Remove after delay
|
||||||
|
setTimeout(() => {
|
||||||
|
toast.classList.add('translate-x-full', 'opacity-0');
|
||||||
|
setTimeout(() => toast.remove(), 300);
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Format Utilities
|
||||||
|
function formatTimestamp(timestamp) {
|
||||||
|
if (!timestamp) return '从未同步';
|
||||||
|
const date = new Date(timestamp);
|
||||||
|
const now = new Date();
|
||||||
|
const diff = now - date;
|
||||||
|
|
||||||
|
if (diff < 60000) return '刚刚';
|
||||||
|
if (diff < 3600000) return `${Math.floor(diff / 60000)}分钟前`;
|
||||||
|
if (diff < 86400000) return `${Math.floor(diff / 3600000)}小时前`;
|
||||||
|
|
||||||
|
return date.toLocaleString('zh-CN', {
|
||||||
|
month: '2-digit',
|
||||||
|
day: '2-digit',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStatusConfig(status) {
|
||||||
|
switch (status) {
|
||||||
|
case 'syncing':
|
||||||
|
return { text: '同步中', class: 'bg-yellow-500/80 text-white border-yellow-400/50 animate-pulse' };
|
||||||
|
case 'success':
|
||||||
|
return { text: '已同步', class: 'bg-green-500/80 text-white border-green-400/50' };
|
||||||
|
case 'failed':
|
||||||
|
case 'error':
|
||||||
|
return { text: '失败', class: 'bg-red-500/80 text-white border-red-400/50' };
|
||||||
|
default:
|
||||||
|
return { text: '待同步', class: 'bg-gray-500/50 text-gray-300 border-gray-400/30' };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Core Logic
|
||||||
|
async function loadPlaylists() {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${API_BASE}/playlists`);
|
||||||
|
if (!response.ok) throw new Error('加载歌单失败');
|
||||||
|
const data = await response.json();
|
||||||
|
|
||||||
|
// Deep compare to avoid unnecessary re-renders if nothing changed
|
||||||
|
// For simplicity, we just check length and status of syncing items
|
||||||
|
// But to ensure progress bars update smoothly, we re-render or update existing
|
||||||
|
// Here we'll re-render for simplicity as the list is likely small
|
||||||
|
playlists = data;
|
||||||
|
updateStats();
|
||||||
|
renderPlaylists();
|
||||||
|
|
||||||
|
// Adjust polling based on activity
|
||||||
|
const anySyncing = playlists.some(p => p.status === 'syncing');
|
||||||
|
adjustPolling(anySyncing);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载歌单失败:', error);
|
||||||
|
showToast(error.message, 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function adjustPolling(isActive) {
|
||||||
|
if (isActive && !pollingInterval) {
|
||||||
|
pollingInterval = setInterval(loadPlaylists, 2000);
|
||||||
|
} else if (!isActive && pollingInterval) {
|
||||||
|
clearInterval(pollingInterval);
|
||||||
|
pollingInterval = null;
|
||||||
|
// Poll infrequently when idle just in case
|
||||||
|
pollingInterval = setInterval(loadPlaylists, 10000);
|
||||||
|
} else if (!pollingInterval) {
|
||||||
|
// Default idle polling
|
||||||
|
pollingInterval = setInterval(loadPlaylists, 10000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateStats() {
|
||||||
|
const total = playlists.length;
|
||||||
|
const synced = playlists.filter(p => p.status === 'success').length;
|
||||||
|
const syncing = playlists.filter(p => p.status === 'syncing').length;
|
||||||
|
const songs = playlists.reduce((acc, curr) => acc + (curr.songs?.length || 0), 0);
|
||||||
|
|
||||||
|
// Animate numbers
|
||||||
|
animateValue('stat-total', parseInt(document.getElementById('stat-total').innerText), total, 500);
|
||||||
|
animateValue('stat-synced', parseInt(document.getElementById('stat-synced').innerText), synced, 500);
|
||||||
|
animateValue('stat-songs', parseInt(document.getElementById('stat-songs').innerText), songs, 500);
|
||||||
|
animateValue('stat-syncing', parseInt(document.getElementById('stat-syncing').innerText), syncing, 500);
|
||||||
|
|
||||||
|
const statsContainer = document.getElementById('stats-container');
|
||||||
|
if (total > 0) {
|
||||||
|
statsContainer.classList.remove('hidden');
|
||||||
|
} else {
|
||||||
|
statsContainer.classList.add('hidden');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function animateValue(id, start, end, duration) {
|
||||||
|
if (start === end) return;
|
||||||
|
const obj = document.getElementById(id);
|
||||||
|
const range = end - start;
|
||||||
|
let current = start;
|
||||||
|
const increment = end > start ? 1 : -1;
|
||||||
|
const stepTime = Math.abs(Math.floor(duration / range));
|
||||||
|
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
current += increment;
|
||||||
|
obj.innerHTML = current;
|
||||||
|
if (current == end) {
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
|
}, Math.max(stepTime, 20)); // Cap speed
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderPlaylists() {
|
||||||
|
const grid = document.getElementById('playlist-grid');
|
||||||
|
const emptyState = document.getElementById('empty-state');
|
||||||
|
const template = document.getElementById('playlist-card-template');
|
||||||
|
|
||||||
|
if (playlists.length === 0) {
|
||||||
|
grid.innerHTML = '';
|
||||||
|
emptyState.classList.remove('hidden');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
emptyState.classList.add('hidden');
|
||||||
|
|
||||||
|
// We want to preserve existing elements to keep animations smooth if possible
|
||||||
|
// But full re-render is safer for state consistency.
|
||||||
|
// Optimization: Diffing by ID could be done here.
|
||||||
|
|
||||||
|
grid.innerHTML = ''; // Simple clear for now
|
||||||
|
|
||||||
|
playlists.forEach(playlist => {
|
||||||
|
const clone = template.content.cloneNode(true);
|
||||||
|
const card = clone.querySelector('div'); // The root div
|
||||||
|
|
||||||
|
// Data binding
|
||||||
|
const img = clone.querySelector('.playlist-cover');
|
||||||
|
img.src = playlist.cover || 'https://p2.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg'; // Fallback image
|
||||||
|
img.alt = playlist.name;
|
||||||
|
|
||||||
|
clone.querySelector('.playlist-name').textContent = playlist.name;
|
||||||
|
clone.querySelector('.playlist-count').textContent = (playlist.songs || []).length;
|
||||||
|
clone.querySelector('.playlist-date').textContent = formatTimestamp(playlist.lastSyncTime);
|
||||||
|
clone.querySelector('.playlist-id').textContent = `ID: ${playlist.neteaseId}`;
|
||||||
|
clone.querySelector('.playlist-link').href = `https://music.163.com/#/playlist?id=${playlist.neteaseId}`;
|
||||||
|
|
||||||
|
// Status Badge
|
||||||
|
const statusConfig = getStatusConfig(playlist.status);
|
||||||
|
const badge = clone.querySelector('.playlist-status');
|
||||||
|
badge.textContent = statusConfig.text;
|
||||||
|
badge.className = `playlist-status px-2.5 py-1 rounded-full text-xs font-medium backdrop-blur-md border ${statusConfig.class}`;
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
const syncBtn = clone.querySelector('.action-sync');
|
||||||
|
const deleteBtn = clone.querySelector('.action-delete');
|
||||||
|
|
||||||
|
syncBtn.onclick = () => syncPlaylist(playlist.id);
|
||||||
|
deleteBtn.onclick = () => deletePlaylist(playlist.id);
|
||||||
|
|
||||||
|
if (playlist.status === 'syncing') {
|
||||||
|
syncBtn.disabled = true;
|
||||||
|
syncBtn.classList.add('opacity-50', 'cursor-not-allowed');
|
||||||
|
syncBtn.querySelector('i').classList.add('fa-spin');
|
||||||
|
|
||||||
|
// Show Progress Overlay
|
||||||
|
const overlay = clone.querySelector('.sync-overlay');
|
||||||
|
overlay.classList.remove('translate-y-full');
|
||||||
|
|
||||||
|
clone.querySelector('.sync-message').textContent = playlist.syncMessage || '同步中...';
|
||||||
|
clone.querySelector('.sync-percent').textContent = `${playlist.syncProgress || 0}%`;
|
||||||
|
clone.querySelector('.sync-progress-bar').style.width = `${playlist.syncProgress || 0}%`;
|
||||||
|
} else {
|
||||||
|
// Hide overlay is default by CSS class
|
||||||
|
}
|
||||||
|
|
||||||
|
grid.appendChild(clone);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actions
|
||||||
|
async function addPlaylist() {
|
||||||
|
const input = document.getElementById('playlistInput');
|
||||||
|
const value = input.value.trim();
|
||||||
|
|
||||||
|
if (!value) {
|
||||||
|
showToast('请输入歌单 ID 或链接', 'warning');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const btn = document.querySelector('button[onclick="addPlaylist()"]');
|
||||||
|
const originalIcon = btn.innerHTML;
|
||||||
|
btn.disabled = true;
|
||||||
|
btn.innerHTML = '<i class="fa-solid fa-circle-notch fa-spin"></i> 处理中...';
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${API_BASE}/playlists`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ url: value })
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) {
|
||||||
|
const error = await response.json();
|
||||||
|
throw new Error(error.error || '添加歌单失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
await loadPlaylists(); // Refresh list
|
||||||
|
input.value = '';
|
||||||
|
showToast('歌单添加成功', 'success');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('添加歌单失败:', error);
|
||||||
|
showToast(error.message, 'error');
|
||||||
|
} finally {
|
||||||
|
btn.disabled = false;
|
||||||
|
btn.innerHTML = originalIcon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deletePlaylist(id) {
|
||||||
|
if (!confirm('确定要移除这个歌单吗?')) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${API_BASE}/playlists/${id}`, {
|
||||||
|
method: 'DELETE'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) throw new Error('删除失败');
|
||||||
|
|
||||||
|
showToast('歌单已移除', 'success');
|
||||||
|
// Optimistic update
|
||||||
|
playlists = playlists.filter(p => p.id !== id);
|
||||||
|
updateStats();
|
||||||
|
renderPlaylists();
|
||||||
|
} catch (error) {
|
||||||
|
showToast(error.message, 'error');
|
||||||
|
loadPlaylists(); // Revert on error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function syncPlaylist(id) {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${API_BASE}/playlists/${id}/sync`, {
|
||||||
|
method: 'POST'
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.ok) throw new Error('启动同步失败');
|
||||||
|
|
||||||
|
showToast('已启动同步任务', 'info');
|
||||||
|
loadPlaylists(); // Update UI immediately to show syncing state
|
||||||
|
} catch (error) {
|
||||||
|
showToast(error.message, 'error');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Input Handler
|
||||||
|
document.getElementById('playlistInput').addEventListener('keypress', (e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
addPlaylist();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Initial Load
|
||||||
|
loadPlaylists();
|
||||||
224
Netease-sync/public/index.html
Normal file
224
Netease-sync/public/index.html
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN" class="dark">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
|
<meta name="theme-color" content="#000000">
|
||||||
|
<title>网易云音乐同步</title>
|
||||||
|
<script src="https://cdn.tailwindcss.com"></script>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
|
<script>
|
||||||
|
tailwind.config = {
|
||||||
|
darkMode: 'class',
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
netease: '#E60026',
|
||||||
|
glass: {
|
||||||
|
100: 'rgba(255, 255, 255, 0.1)',
|
||||||
|
200: 'rgba(255, 255, 255, 0.2)',
|
||||||
|
300: 'rgba(255, 255, 255, 0.3)',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
animation: {
|
||||||
|
'pulse-slow': 'pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
background: #121212;
|
||||||
|
background-image:
|
||||||
|
radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%),
|
||||||
|
radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%),
|
||||||
|
radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass-panel {
|
||||||
|
background: rgba(30, 30, 30, 0.6);
|
||||||
|
backdrop-filter: blur(12px);
|
||||||
|
-webkit-backdrop-filter: blur(12px);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||||
|
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass-input {
|
||||||
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
color: white;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.glass-input:focus {
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
border-color: rgba(230, 0, 38, 0.5);
|
||||||
|
outline: none;
|
||||||
|
box-shadow: 0 0 0 2px rgba(230, 0, 38, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-scrollbar::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-track {
|
||||||
|
background: rgba(255, 255, 255, 0.02);
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes spin {
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
.spinner {
|
||||||
|
animation: spin 1s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-clamp-2 {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body class="text-white custom-scrollbar selection:bg-netease selection:text-white">
|
||||||
|
<div class="container mx-auto px-4 py-8 max-w-7xl">
|
||||||
|
<!-- Header -->
|
||||||
|
<header class="flex flex-col md:flex-row items-center justify-between mb-10 gap-6">
|
||||||
|
<div class="flex items-center gap-4">
|
||||||
|
<div class="w-12 h-12 rounded-full bg-gradient-to-br from-netease to-red-700 flex items-center justify-center shadow-lg shadow-netease/30">
|
||||||
|
<i class="fa-solid fa-cloud text-xl"></i>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h1 class="text-2xl font-bold tracking-tight">网易云音乐同步</h1>
|
||||||
|
<p class="text-gray-400 text-sm">Sync Netease Cloud Music to Navidrome</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="glass-panel rounded-full p-1.5 flex w-full md:w-auto max-w-md">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
id="playlistInput"
|
||||||
|
placeholder="输入歌单 ID 或链接..."
|
||||||
|
class="bg-transparent border-none text-white px-4 py-2 w-full focus:outline-none placeholder-gray-500 text-sm"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
onclick="addPlaylist()"
|
||||||
|
class="bg-netease hover:bg-red-700 text-white px-6 py-2 rounded-full font-medium text-sm transition-all shadow-lg shadow-netease/20 flex items-center gap-2 whitespace-nowrap"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-plus"></i>
|
||||||
|
<span>添加</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- Notifications -->
|
||||||
|
<div id="toast-container" class="fixed top-6 right-6 z-50 flex flex-col gap-3 pointer-events-none"></div>
|
||||||
|
|
||||||
|
<!-- Content -->
|
||||||
|
<main>
|
||||||
|
<!-- Stats Overview -->
|
||||||
|
<div id="stats-container" class="grid grid-cols-2 md:grid-cols-4 gap-4 mb-8 hidden">
|
||||||
|
<div class="glass-panel rounded-2xl p-4 flex flex-col items-center justify-center text-center">
|
||||||
|
<span class="text-3xl font-bold text-white mb-1" id="stat-total">0</span>
|
||||||
|
<span class="text-xs text-gray-400 uppercase tracking-wider">总歌单</span>
|
||||||
|
</div>
|
||||||
|
<div class="glass-panel rounded-2xl p-4 flex flex-col items-center justify-center text-center">
|
||||||
|
<span class="text-3xl font-bold text-green-400 mb-1" id="stat-synced">0</span>
|
||||||
|
<span class="text-xs text-gray-400 uppercase tracking-wider">已同步</span>
|
||||||
|
</div>
|
||||||
|
<div class="glass-panel rounded-2xl p-4 flex flex-col items-center justify-center text-center">
|
||||||
|
<span class="text-3xl font-bold text-blue-400 mb-1" id="stat-songs">0</span>
|
||||||
|
<span class="text-xs text-gray-400 uppercase tracking-wider">总歌曲</span>
|
||||||
|
</div>
|
||||||
|
<div class="glass-panel rounded-2xl p-4 flex flex-col items-center justify-center text-center">
|
||||||
|
<span class="text-3xl font-bold text-yellow-400 mb-1" id="stat-syncing">0</span>
|
||||||
|
<span class="text-xs text-gray-400 uppercase tracking-wider">同步中</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Empty State -->
|
||||||
|
<div id="empty-state" class="hidden text-center py-20">
|
||||||
|
<div class="w-24 h-24 bg-white/5 rounded-full flex items-center justify-center mx-auto mb-6">
|
||||||
|
<i class="fa-solid fa-music text-4xl text-white/20"></i>
|
||||||
|
</div>
|
||||||
|
<h3 class="text-xl font-medium text-white mb-2">还没有歌单</h3>
|
||||||
|
<p class="text-gray-500 max-w-sm mx-auto">在上方输入框粘贴网易云音乐歌单链接或 ID,开始构建你的私人音乐库。</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Grid Layout -->
|
||||||
|
<div id="playlist-grid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
|
||||||
|
<!-- Cards will be injected here -->
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Templates -->
|
||||||
|
<template id="playlist-card-template">
|
||||||
|
<div class="glass-panel rounded-2xl overflow-hidden group hover:bg-white/5 transition-all duration-300 relative">
|
||||||
|
<!-- Cover Image & Gradient Overlay -->
|
||||||
|
<div class="aspect-square relative overflow-hidden bg-gray-800">
|
||||||
|
<img src="" alt="Cover" class="w-full h-full object-cover transition-transform duration-700 group-hover:scale-110 playlist-cover">
|
||||||
|
<div class="absolute inset-0 bg-gradient-to-t from-black/90 via-black/40 to-transparent opacity-80 group-hover:opacity-60 transition-opacity"></div>
|
||||||
|
|
||||||
|
<!-- Status Badge -->
|
||||||
|
<div class="absolute top-3 right-3">
|
||||||
|
<span class="playlist-status px-2.5 py-1 rounded-full text-xs font-medium backdrop-blur-md bg-black/40 border border-white/10">
|
||||||
|
待同步
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Action Buttons (Hover) -->
|
||||||
|
<div class="absolute inset-0 flex items-center justify-center gap-3 opacity-0 group-hover:opacity-100 transition-opacity duration-300 bg-black/40 backdrop-blur-sm">
|
||||||
|
<button class="action-sync w-12 h-12 rounded-full bg-white text-black hover:scale-110 transition-transform flex items-center justify-center shadow-xl">
|
||||||
|
<i class="fa-solid fa-rotate"></i>
|
||||||
|
</button>
|
||||||
|
<button class="action-delete w-12 h-12 rounded-full bg-red-500/80 text-white hover:bg-red-500 hover:scale-110 transition-all flex items-center justify-center shadow-xl backdrop-blur-md">
|
||||||
|
<i class="fa-solid fa-trash"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Progress Bar Overlay (When Syncing) -->
|
||||||
|
<div class="sync-overlay absolute inset-x-0 bottom-0 bg-black/80 backdrop-blur-md p-4 transform translate-y-full transition-transform duration-300">
|
||||||
|
<div class="flex justify-between text-xs text-gray-300 mb-1.5">
|
||||||
|
<span class="sync-message truncate pr-2">准备中...</span>
|
||||||
|
<span class="sync-percent font-mono">0%</span>
|
||||||
|
</div>
|
||||||
|
<div class="w-full bg-gray-700 rounded-full h-1.5 overflow-hidden">
|
||||||
|
<div class="sync-progress-bar bg-netease h-1.5 rounded-full transition-all duration-300" style="width: 0%"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Info Section -->
|
||||||
|
<div class="p-5">
|
||||||
|
<h3 class="playlist-name font-bold text-lg mb-1 truncate group-hover:text-netease transition-colors">歌单名称</h3>
|
||||||
|
<div class="flex items-center gap-2 text-xs text-gray-400 mb-4">
|
||||||
|
<span class="flex items-center gap-1 bg-white/5 px-2 py-0.5 rounded">
|
||||||
|
<i class="fa-solid fa-music text-[10px]"></i>
|
||||||
|
<span class="playlist-count">0</span>
|
||||||
|
</span>
|
||||||
|
<span class="playlist-date">刚刚</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex items-center justify-between text-xs text-gray-500 border-t border-white/5 pt-3 mt-1">
|
||||||
|
<span class="font-mono playlist-id opacity-50">ID: 000000</span>
|
||||||
|
<a href="#" target="_blank" class="playlist-link hover:text-white transition-colors flex items-center gap-1">
|
||||||
|
打开网易云 <i class="fa-solid fa-arrow-up-right-from-square text-[10px]"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1216
Netease-sync/server.js
Normal file
1216
Netease-sync/server.js
Normal file
File diff suppressed because it is too large
Load Diff
141
Netease-sync/需求.md
Normal file
141
Netease-sync/需求.md
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
# Netease-sync 需求文档
|
||||||
|
|
||||||
|
## 项目概述
|
||||||
|
在当前目录下新建一个简单的 Node.js 项目,实现和 Navidrome 的联动,将网易云音乐歌单同步到 Navidrome。
|
||||||
|
|
||||||
|
## 核心功能
|
||||||
|
|
||||||
|
### 1. 歌单输入
|
||||||
|
- 前台页面支持输入网易云音乐的歌单 ID 或分享链接
|
||||||
|
- 支持从歌单 URL 中提取 ID(如 `https://music.163.com/#/playlist?id=123456` 提取 `123456`)
|
||||||
|
- 只支持网易云音乐平台
|
||||||
|
|
||||||
|
### 2. 歌单读取
|
||||||
|
- 调用 TuneHub API 获取歌单详情
|
||||||
|
- API: `GET /api/?source=netease&id={playlistId}&type=playlist`
|
||||||
|
- 获取歌单名称、封面、描述、歌曲列表等元数据
|
||||||
|
|
||||||
|
### 3. 歌曲下载
|
||||||
|
- 调用现有的 sync-server 下载逻辑
|
||||||
|
- 包括元数据写入(title, artist, album, cover)
|
||||||
|
- **不创建歌单缓存 JSON 文件**,避免和主 app 混淆
|
||||||
|
- 下载到 sync-server 的 music 目录(Navidrome 也读取此目录)
|
||||||
|
- 如果下载失败,尝试换源(根据 api.md 支持的平台:netease, kuwo, qq)
|
||||||
|
- **不重试**,失败则跳过
|
||||||
|
|
||||||
|
### 4. Navidrome 歌单创建
|
||||||
|
- 使用 Navidrome 的 Subsonic API
|
||||||
|
- 在 Navidrome 中创建同名歌单
|
||||||
|
- 将下载的歌曲加入歌单
|
||||||
|
- 同步歌单的所有元数据(封面、描述等)
|
||||||
|
|
||||||
|
### 5. 同步策略
|
||||||
|
- **增量同步**:只新增歌曲,不删除已有歌曲
|
||||||
|
- 通过网易云音乐歌曲 ID 判断,在本地维护一个映射表(netease_song_id -> navidrome_song_id)
|
||||||
|
- **定时同步**:每 300 秒自动同步一次(可配置)
|
||||||
|
- 支持手动立即同步
|
||||||
|
|
||||||
|
### 6. 前端界面
|
||||||
|
- 显示已添加的歌单列表
|
||||||
|
- 显示每个歌单的同步状态(同步中/成功/失败)
|
||||||
|
- 显示上次同步时间
|
||||||
|
- 提供立即同步按钮
|
||||||
|
- 支持添加/删除歌单
|
||||||
|
|
||||||
|
## 配置项
|
||||||
|
|
||||||
|
### Docker 环境变量
|
||||||
|
- `NAVIDROME_URL`: Navidrome 服务器地址(如 `http://navidrome:4533`)
|
||||||
|
- `NAVIDROME_USERNAME`: Navidrome 用户名
|
||||||
|
- `NAVIDROME_PASSWORD`: Navidrome 密码
|
||||||
|
- `SYNC_INTERVAL`: 同步间隔(秒),默认 300
|
||||||
|
- `SYNC_SERVER_URL`: sync-server 地址(如 `http://sync-service:3001`)
|
||||||
|
- `SYNC_SERVER_TOKEN`: sync-server 的 token(用于 KV API)
|
||||||
|
- `TUNEHUB_API_URL`: TuneHub API 地址(如 `https://music-dl.sayqz.com`)
|
||||||
|
|
||||||
|
## 技术架构
|
||||||
|
|
||||||
|
### 后端
|
||||||
|
- Node.js + Express
|
||||||
|
- 调用 sync-server 的 KV API 传递歌曲列表
|
||||||
|
- 调用 Navidrome Subsonic API 创建歌单
|
||||||
|
- 定时任务:每 N 秒检查并同步歌单
|
||||||
|
- 数据持久化:JSON 文件存储歌单列表和映射表
|
||||||
|
|
||||||
|
### 前端
|
||||||
|
- 简单的 HTML + JavaScript 页面
|
||||||
|
- 实时显示同步状态(WebSocket 或轮询)
|
||||||
|
- 添加/删除歌单功能
|
||||||
|
|
||||||
|
## Subsonic API 集成
|
||||||
|
|
||||||
|
### 认证
|
||||||
|
所有 API 请求需要包含以下参数:
|
||||||
|
- `u`: 用户名
|
||||||
|
- `p`: 密码(明文或 hex 格式)
|
||||||
|
- `v`: API 版本(如 `1.16.0`)
|
||||||
|
- `c`: 客户端名称(如 `netease-sync`)
|
||||||
|
|
||||||
|
### 主要端点
|
||||||
|
1. **创建歌单**: `createPlaylist`
|
||||||
|
- 参数:`name`(歌单名称)、`songId`(歌曲 ID 列表,逗号分隔)
|
||||||
|
- 返回:创建的歌单 ID
|
||||||
|
|
||||||
|
2. **更新歌单**: `updatePlaylist`
|
||||||
|
- 参数:`playlistId`(歌单 ID)、`songIdToAdd`(要添加的歌曲 ID)
|
||||||
|
|
||||||
|
3. **获取歌单列表**: `getPlaylists`
|
||||||
|
|
||||||
|
4. **搜索歌曲**: `search3`
|
||||||
|
- 参数:`query`(搜索关键词)
|
||||||
|
- 用于根据文件名查找 Navidrome 中的歌曲 ID
|
||||||
|
|
||||||
|
## 歌曲匹配策略
|
||||||
|
|
||||||
|
参考 sync-server 的去重逻辑,文件名格式为:`Artist - Name [source_id].ext`
|
||||||
|
|
||||||
|
匹配步骤:
|
||||||
|
1. 下载完成后,Navidrome 会自动扫描新歌曲
|
||||||
|
2. 通过 `search3` 搜索文件名(如 `Artist - Name [netease_id]`)来获取 Navidrome 的歌曲 ID
|
||||||
|
3. 将网易云音乐歌曲 ID 映射到 Navidrome 歌曲 ID
|
||||||
|
|
||||||
|
## 数据结构
|
||||||
|
|
||||||
|
### 歌单列表 (playlists.json)
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"playlists": [
|
||||||
|
{
|
||||||
|
"id": "netease_123456",
|
||||||
|
"neteaseId": "123456",
|
||||||
|
"name": "歌单名称",
|
||||||
|
"cover": "封面URL",
|
||||||
|
"description": "歌单描述",
|
||||||
|
"navidromePlaylistId": "navidrome_playlist_id",
|
||||||
|
"lastSyncTime": "2025-01-12T10:00:00Z",
|
||||||
|
"syncStatus": "success",
|
||||||
|
"songMapping": {
|
||||||
|
"netease_song_id_1": "navidrome_song_id_1",
|
||||||
|
"netease_song_id_2": "navidrome_song_id_2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 换源逻辑
|
||||||
|
|
||||||
|
如果网易云音乐下载失败,尝试换源:
|
||||||
|
- 优先级:kuwo -> qq
|
||||||
|
- 每个平台只尝试一次,不重试
|
||||||
|
|
||||||
|
## 错误处理
|
||||||
|
|
||||||
|
- 某首歌下载失败,跳过继续下载其他歌曲
|
||||||
|
- 不重试
|
||||||
|
- 错误日志输出到 Docker 控制台,不存储
|
||||||
|
|
||||||
|
## Navidrome 扫描延迟
|
||||||
|
|
||||||
|
- Navidrome 扫描新歌曲很快,不处理延迟
|
||||||
|
- 在添加到歌单时直接搜索歌曲 ID
|
||||||
218
api.md
218
api.md
@@ -148,6 +148,224 @@ TuneHub 是一个统一的音乐信息解析服务。它打破了不同音乐平
|
|||||||
* `source`: `string` - **必需**. 平台标识.
|
* `source`: `string` - **必需**. 平台标识.
|
||||||
* `id`: `string` - **必需**. 歌单 ID.
|
* `id`: `string` - **必需**. 歌单 ID.
|
||||||
* `type`: `string` - **必需**. 固定为 `playlist`.
|
* `type`: `string` - **必需**. 固定为 `playlist`.
|
||||||
|
结果示例:
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "success",
|
||||||
|
"data": {
|
||||||
|
"list": [
|
||||||
|
{
|
||||||
|
"id": "2722391361",
|
||||||
|
"name": "天后 (live)",
|
||||||
|
"artist": "李佳薇",
|
||||||
|
"album": "歌手2025 第8期",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=2722391361&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=2722391361&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=2722391361&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=2722391361&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac24bit",
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1368753797",
|
||||||
|
"name": "法兰西多士",
|
||||||
|
"artist": "告五人",
|
||||||
|
"album": "我肯定在几百年前就说过爱你",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=1368753797&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=1368753797&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=1368753797&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=1368753797&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac24bit",
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "155886",
|
||||||
|
"name": "光明",
|
||||||
|
"artist": "汪峰",
|
||||||
|
"album": "信仰在空中飘扬",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=155886&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=155886&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=155886&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=155886&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "569214247",
|
||||||
|
"name": "平凡的一天",
|
||||||
|
"artist": "毛不易",
|
||||||
|
"album": "平凡的一天",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=569214247&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=569214247&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=569214247&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=569214247&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1810392410",
|
||||||
|
"name": "回音",
|
||||||
|
"artist": "神秘的小鸡蛋",
|
||||||
|
"album": "感觉",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=1810392410&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=1810392410&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=1810392410&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=1810392410&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "569200213",
|
||||||
|
"name": "消愁",
|
||||||
|
"artist": "毛不易",
|
||||||
|
"album": "平凡的一天",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=569200213&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=569200213&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=569200213&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=569200213&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "2083191501",
|
||||||
|
"name": "郁郁而终",
|
||||||
|
"artist": "马英杰",
|
||||||
|
"album": "郁郁而终(重制版)",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=2083191501&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=2083191501&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=2083191501&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=2083191501&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac24bit",
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1838919030",
|
||||||
|
"name": "王招君",
|
||||||
|
"artist": "任素汐",
|
||||||
|
"album": "TA·说",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=1838919030&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=1838919030&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=1838919030&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=1838919030&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac24bit",
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "2105734399",
|
||||||
|
"name": "风过千里",
|
||||||
|
"artist": "雪域任运",
|
||||||
|
"album": "风过千里",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=2105734399&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=2105734399&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=2105734399&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=2105734399&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1974443814",
|
||||||
|
"name": "我记得",
|
||||||
|
"artist": "赵雷",
|
||||||
|
"album": "署前街少年",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=1974443814&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=1974443814&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=1974443814&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=1974443814&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "155899",
|
||||||
|
"name": "勇敢的心",
|
||||||
|
"artist": "汪峰",
|
||||||
|
"album": "勇敢的心",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=155899&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=155899&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=155899&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=155899&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1308081071",
|
||||||
|
"name": "作曲家 (Live)",
|
||||||
|
"artist": "刘郡格",
|
||||||
|
"album": "2018中国好声音 第8期",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=1308081071&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=1308081071&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=1308081071&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=1308081071&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "488641876",
|
||||||
|
"name": "有一个地方叫远方",
|
||||||
|
"artist": "曾昭玮",
|
||||||
|
"album": "有一个地方叫远方",
|
||||||
|
"info": "https://music-dl.sayqz.com/api/?source=netease&id=488641876&type=info",
|
||||||
|
"url": "https://music-dl.sayqz.com/api/?source=netease&id=488641876&type=url",
|
||||||
|
"pic": "https://music-dl.sayqz.com/api/?source=netease&id=488641876&type=pic",
|
||||||
|
"lrc": "https://music-dl.sayqz.com/api/?source=netease&id=488641876&type=lrc",
|
||||||
|
"types": [
|
||||||
|
"flac",
|
||||||
|
"320k",
|
||||||
|
"128k"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total": 13,
|
||||||
|
"source": "netease",
|
||||||
|
"info": {
|
||||||
|
"name": "为你降次元喜欢的音乐",
|
||||||
|
"pic": "https://p1.music.126.net/Qara552B1Q3VBJnwggJA2A==/109951171404861681.jpg",
|
||||||
|
"desc": "",
|
||||||
|
"author": "为你降次元",
|
||||||
|
"playCount": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"timestamp": "2026-01-12T18:32:10.516+08:00"
|
||||||
|
}
|
||||||
|
|
||||||
### 8. 获取排行榜列表
|
### 8. 获取排行榜列表
|
||||||
|
|
||||||
|
|||||||
@@ -17,3 +17,26 @@ services:
|
|||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
- ./music:/app/music
|
- ./music:/app/music
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
netease-sync:
|
||||||
|
container_name: netease-sync
|
||||||
|
build: ./Netease-sync
|
||||||
|
ports:
|
||||||
|
- "7483:3000"
|
||||||
|
environment:
|
||||||
|
- PORT=3000
|
||||||
|
- DATA_DIR=/app/data
|
||||||
|
- MUSIC_DIR=/app/music
|
||||||
|
- NAVIDROME_URL=${NAVIDROME_URL:-http://navidrome:4533}
|
||||||
|
- NAVIDROME_USERNAME=${NAVIDROME_USERNAME:-admin}
|
||||||
|
- NAVIDROME_PASSWORD=${NAVIDROME_PASSWORD:-}
|
||||||
|
- SYNC_INTERVAL=${SYNC_INTERVAL:-300}
|
||||||
|
- SYNC_SERVER_URL=http://sync-service:3001
|
||||||
|
- SYNC_SERVER_TOKEN=default
|
||||||
|
- TUNEHUB_API_URL=https://music-dl.sayqz.com
|
||||||
|
volumes:
|
||||||
|
- ./data:/app/data
|
||||||
|
- ./music:/app/music
|
||||||
|
depends_on:
|
||||||
|
- sync-service
|
||||||
|
restart: unless-stopped
|
||||||
123
index.html
123
index.html
@@ -138,7 +138,9 @@
|
|||||||
<script type="text/babel">
|
<script type="text/babel">
|
||||||
const { useState, useEffect, useRef, useMemo, useCallback } = React;
|
const { useState, useEffect, useRef, useMemo, useCallback } = React;
|
||||||
|
|
||||||
const API_BASE = "https://music-dl.sayqz.com";
|
// Use relative path for API proxy to avoid CORS issues
|
||||||
|
// Nginx forwards /api/ to sync-server, which proxies /music-api to music-dl.sayqz.com
|
||||||
|
const API_BASE = "/music-api";
|
||||||
// Use relative path for sync service, assuming Nginx proxy is configured to forward /api/kv to the sync service
|
// Use relative path for sync service, assuming Nginx proxy is configured to forward /api/kv to the sync service
|
||||||
const SYNC_API_BASE = "/api";
|
const SYNC_API_BASE = "/api";
|
||||||
|
|
||||||
@@ -148,10 +150,19 @@
|
|||||||
{ id: 'qq', name: 'QQ音乐' },
|
{ id: 'qq', name: 'QQ音乐' },
|
||||||
{ id: 'kugou', name: '酷狗' }
|
{ id: 'kugou', name: '酷狗' }
|
||||||
];
|
];
|
||||||
|
const IS_IOS = (() => {
|
||||||
|
if (typeof navigator === 'undefined') return false;
|
||||||
|
const ua = navigator.userAgent || '';
|
||||||
|
const platform = navigator.platform || '';
|
||||||
|
const iOSUA = /iPad|iPhone|iPod/.test(ua);
|
||||||
|
const iPadOS = platform === 'MacIntel' && navigator.maxTouchPoints > 1;
|
||||||
|
return iOSUA || iPadOS;
|
||||||
|
})();
|
||||||
|
|
||||||
// --- Utility Functions ---
|
// --- Utility Functions ---
|
||||||
const formatTime = (seconds) => {
|
const formatTime = (seconds) => {
|
||||||
if (!seconds) return "0:00";
|
// 增加保护:处理负数、Infinity、NaN等异常值
|
||||||
|
if (!Number.isFinite(seconds) || seconds < 0) return "0:00";
|
||||||
const mins = Math.floor(seconds / 60);
|
const mins = Math.floor(seconds / 60);
|
||||||
const secs = Math.floor(seconds % 60);
|
const secs = Math.floor(seconds % 60);
|
||||||
return `${mins}:${secs < 10 ? '0' : ''}${secs}`;
|
return `${mins}:${secs < 10 ? '0' : ''}${secs}`;
|
||||||
@@ -224,11 +235,14 @@
|
|||||||
if (audio.seekable && audio.seekable.length) {
|
if (audio.seekable && audio.seekable.length) {
|
||||||
try {
|
try {
|
||||||
const end = audio.seekable.end(audio.seekable.length - 1);
|
const end = audio.seekable.end(audio.seekable.length - 1);
|
||||||
|
// 增加负数检查:iOS锁屏时可能返回负数
|
||||||
if (Number.isFinite(end) && end > 0) return end;
|
if (Number.isFinite(end) && end > 0) return end;
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return getSongDurationSeconds(song);
|
const fallbackDuration = getSongDurationSeconds(song);
|
||||||
|
// 再次确保不会返回负数或异常值
|
||||||
|
return Number.isFinite(fallbackDuration) && fallbackDuration > 0 ? fallbackDuration : 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- ID Normalization ---
|
// --- ID Normalization ---
|
||||||
@@ -244,7 +258,7 @@
|
|||||||
const api = {
|
const api = {
|
||||||
search: async (keyword, source = 'netease', page = 1) => {
|
search: async (keyword, source = 'netease', page = 1) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_BASE}/api/?type=search&keyword=${encodeURIComponent(keyword)}&source=${source}&page=${page}`);
|
const res = await fetch(`${API_BASE}?type=search&keyword=${encodeURIComponent(keyword)}&source=${source}&page=${page}`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
const payload = data.data || {};
|
const payload = data.data || {};
|
||||||
@@ -257,14 +271,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSongUrl: (id, source, br = '320k') => {
|
getSongUrl: (id, source, br = '320k') => {
|
||||||
return `${API_BASE}/api/?source=${source}&id=${id}&type=url&br=${br}`;
|
return `${API_BASE}?source=${source}&id=${id}&type=url&br=${br}`;
|
||||||
},
|
},
|
||||||
getPicUrl: (id, source) => {
|
getPicUrl: (id, source) => {
|
||||||
return `${API_BASE}/api/?source=${source}&id=${id}&type=pic`;
|
return `${API_BASE}?source=${source}&id=${id}&type=pic`;
|
||||||
},
|
},
|
||||||
getLrc: async (id, source) => {
|
getLrc: async (id, source) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_BASE}/api/?source=${source}&id=${id}&type=lrc`);
|
const res = await fetch(`${API_BASE}?source=${source}&id=${id}&type=lrc`);
|
||||||
const text = await res.text();
|
const text = await res.text();
|
||||||
return text;
|
return text;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -297,7 +311,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_BASE}/api/?source=${source}&type=toplists`);
|
const res = await fetch(`${API_BASE}/?source=${source}&type=toplists`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
// 兼容多种返回结构:data本身是数组,或者data.list是数组
|
// 兼容多种返回结构:data本身是数组,或者data.list是数组
|
||||||
@@ -314,7 +328,7 @@
|
|||||||
},
|
},
|
||||||
getTopListSongs: async (id, source) => {
|
getTopListSongs: async (id, source) => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_BASE}/api/?source=${source}&id=${id}&type=toplist`);
|
const res = await fetch(`${API_BASE}/?source=${source}&id=${id}&type=toplist`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data.code === 200) {
|
if (data.code === 200) {
|
||||||
const list = Array.isArray(data.data) ? data.data : (data.data.list || data.data.tracks || []);
|
const list = Array.isArray(data.data) ? data.data : (data.data.list || data.data.tracks || []);
|
||||||
@@ -328,7 +342,7 @@
|
|||||||
},
|
},
|
||||||
getPlaylist: async (id, source = 'netease') => {
|
getPlaylist: async (id, source = 'netease') => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_BASE}/api/?type=playlist&id=${id}&source=${source}`);
|
const res = await fetch(`${API_BASE}/?type=playlist&id=${id}&source=${source}`);
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
if (data.code === 200 && data.data && Array.isArray(data.data.list)) {
|
if (data.code === 200 && data.data && Array.isArray(data.data.list)) {
|
||||||
return normalizeSongList(data.data.list);
|
return normalizeSongList(data.data.list);
|
||||||
@@ -945,6 +959,7 @@
|
|||||||
|
|
||||||
const audioRef = useRef(null);
|
const audioRef = useRef(null);
|
||||||
const autoAdvanceLockRef = useRef(false);
|
const autoAdvanceLockRef = useRef(false);
|
||||||
|
const autoNextPendingRef = useRef(false);
|
||||||
const currentSongRef = useRef(null);
|
const currentSongRef = useRef(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -955,6 +970,35 @@
|
|||||||
autoAdvanceLockRef.current = false;
|
autoAdvanceLockRef.current = false;
|
||||||
}, [currentSong]);
|
}, [currentSong]);
|
||||||
|
|
||||||
|
const playAudioWithFallback = (audio, options = {}) => {
|
||||||
|
if (!audio) return;
|
||||||
|
const { deferOnIOS = false } = options;
|
||||||
|
const isHidden = typeof document !== 'undefined' && document.hidden;
|
||||||
|
const shouldDefer = deferOnIOS && IS_IOS && !isHidden;
|
||||||
|
const doPlay = () => {
|
||||||
|
const playPromise = audio.play();
|
||||||
|
if (playPromise && typeof playPromise.catch === 'function') {
|
||||||
|
playPromise.catch(e => {
|
||||||
|
console.warn("Auto-play prevented:", e);
|
||||||
|
if (e && e.name === 'AbortError') return;
|
||||||
|
setIsPlaying(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (shouldDefer) {
|
||||||
|
const onCanPlay = () => {
|
||||||
|
audio.removeEventListener('canplay', onCanPlay);
|
||||||
|
doPlay();
|
||||||
|
};
|
||||||
|
audio.addEventListener('canplay', onCanPlay);
|
||||||
|
try { audio.load(); } catch (e) {}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
doPlay();
|
||||||
|
};
|
||||||
|
|
||||||
// Media Session Refs
|
// Media Session Refs
|
||||||
const playNextRef = useRef(null);
|
const playNextRef = useRef(null);
|
||||||
const playPrevRef = useRef(null);
|
const playPrevRef = useRef(null);
|
||||||
@@ -1185,30 +1229,43 @@
|
|||||||
const triggerAutoNext = () => {
|
const triggerAutoNext = () => {
|
||||||
if (autoAdvanceLockRef.current) return;
|
if (autoAdvanceLockRef.current) return;
|
||||||
autoAdvanceLockRef.current = true;
|
autoAdvanceLockRef.current = true;
|
||||||
playNext(true, { immediate: true });
|
const isHidden = typeof document !== 'undefined' && document.hidden;
|
||||||
|
const immediate = IS_IOS || isHidden;
|
||||||
|
playNext(true, { immediate, deferOnIOS: IS_IOS });
|
||||||
|
};
|
||||||
|
|
||||||
|
const isNearEnd = () => {
|
||||||
|
const durationSeconds = resolveDurationSeconds(audio, currentSongRef.current);
|
||||||
|
if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) return false;
|
||||||
|
// iOS锁屏时timeupdate频率降低,需要更大的提前量
|
||||||
|
const threshold = IS_IOS ? 0.5 : 0.35;
|
||||||
|
return audio.currentTime >= durationSeconds - threshold;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateTime = () => {
|
const updateTime = () => {
|
||||||
setCurrentTime(audio.currentTime);
|
setCurrentTime(audio.currentTime);
|
||||||
if (autoAdvanceLockRef.current) return;
|
if (autoAdvanceLockRef.current) return;
|
||||||
const durationSeconds = resolveDurationSeconds(audio, currentSongRef.current);
|
// 移除iOS限制:所有平台都使用timeupdate检查,解决iOS锁屏时ended事件不触发的问题
|
||||||
if (Number.isFinite(durationSeconds) && durationSeconds > 0) {
|
if (isNearEnd()) triggerAutoNext();
|
||||||
if (audio.currentTime >= durationSeconds - 0.35) {
|
|
||||||
triggerAutoNext();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
const updateDuration = () => setDuration(resolveDurationSeconds(audio, currentSongRef.current));
|
const updateDuration = () => setDuration(resolveDurationSeconds(audio, currentSongRef.current));
|
||||||
const onEnded = () => triggerAutoNext();
|
const onEnded = () => triggerAutoNext();
|
||||||
|
const onPause = () => {
|
||||||
|
if (!IS_IOS) return;
|
||||||
|
if (autoAdvanceLockRef.current) return;
|
||||||
|
if (isNearEnd()) triggerAutoNext();
|
||||||
|
};
|
||||||
|
|
||||||
audio.addEventListener('timeupdate', updateTime);
|
audio.addEventListener('timeupdate', updateTime);
|
||||||
audio.addEventListener('loadedmetadata', updateDuration);
|
audio.addEventListener('loadedmetadata', updateDuration);
|
||||||
audio.addEventListener('ended', onEnded);
|
audio.addEventListener('ended', onEnded);
|
||||||
|
audio.addEventListener('pause', onPause);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
audio.removeEventListener('timeupdate', updateTime);
|
audio.removeEventListener('timeupdate', updateTime);
|
||||||
audio.removeEventListener('loadedmetadata', updateDuration);
|
audio.removeEventListener('loadedmetadata', updateDuration);
|
||||||
audio.removeEventListener('ended', onEnded);
|
audio.removeEventListener('ended', onEnded);
|
||||||
|
audio.removeEventListener('pause', onPause);
|
||||||
};
|
};
|
||||||
}, [playlist, currentSong, mode, volume, quality]);
|
}, [playlist, currentSong, mode, volume, quality]);
|
||||||
|
|
||||||
@@ -1222,20 +1279,21 @@
|
|||||||
// Only update src if it's different to avoid reloading same song on re-render (unless quality changed)
|
// Only update src if it's different to avoid reloading same song on re-render (unless quality changed)
|
||||||
// Note: audioRef.current.src returns full absolute URL
|
// Note: audioRef.current.src returns full absolute URL
|
||||||
const currentSrc = audio.src;
|
const currentSrc = audio.src;
|
||||||
|
const wasPlaying = isPlaying;
|
||||||
|
const deferOnIOS = autoNextPendingRef.current;
|
||||||
|
autoNextPendingRef.current = false;
|
||||||
|
|
||||||
// Simple check if src changed significantly (avoiding minor encoding diffs if possible, but exact match is safer)
|
// Simple check if src changed significantly (avoiding minor encoding diffs if possible, but exact match is safer)
|
||||||
if (currentSrc !== url) {
|
if (currentSrc !== url) {
|
||||||
const wasPlaying = isPlaying;
|
|
||||||
audio.src = url;
|
audio.src = url;
|
||||||
if (wasPlaying) {
|
if (wasPlaying) {
|
||||||
audio.play()
|
playAudioWithFallback(audio, { deferOnIOS });
|
||||||
.then(() => setIsPlaying(true))
|
|
||||||
.catch(e => {
|
|
||||||
console.warn("Auto-play prevented:", e);
|
|
||||||
setIsPlaying(false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
} else if (deferOnIOS && wasPlaying) {
|
||||||
|
playAudioWithFallback(audio, { deferOnIOS: true });
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
autoNextPendingRef.current = false;
|
||||||
}
|
}
|
||||||
}, [currentSong, quality]); // Re-run when quality changes
|
}, [currentSong, quality]); // Re-run when quality changes
|
||||||
|
|
||||||
@@ -1243,7 +1301,7 @@
|
|||||||
if (currentSong) {
|
if (currentSong) {
|
||||||
const audio = audioRef.current;
|
const audio = audioRef.current;
|
||||||
if (!audio) return;
|
if (!audio) return;
|
||||||
if (isPlaying) audio.play().catch(() => setIsPlaying(false));
|
if (isPlaying) playAudioWithFallback(audio);
|
||||||
else audio.pause();
|
else audio.pause();
|
||||||
}
|
}
|
||||||
}, [isPlaying]);
|
}, [isPlaying]);
|
||||||
@@ -1325,11 +1383,17 @@
|
|||||||
const audio = audioRef.current;
|
const audio = audioRef.current;
|
||||||
if (!audio) return;
|
if (!audio) return;
|
||||||
audio.currentTime = 0;
|
audio.currentTime = 0;
|
||||||
audio.play().catch(() => setIsPlaying(false));
|
playAudioWithFallback(audio);
|
||||||
autoAdvanceLockRef.current = false;
|
autoAdvanceLockRef.current = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auto) {
|
||||||
|
autoNextPendingRef.current = !options.immediate;
|
||||||
|
} else {
|
||||||
|
autoNextPendingRef.current = false;
|
||||||
|
}
|
||||||
|
|
||||||
let nextIdx;
|
let nextIdx;
|
||||||
const currIdx = playlist.findIndex(s => s.id === currentSong?.id);
|
const currIdx = playlist.findIndex(s => s.id === currentSong?.id);
|
||||||
|
|
||||||
@@ -1350,12 +1414,7 @@
|
|||||||
if (audio.src !== url) {
|
if (audio.src !== url) {
|
||||||
audio.src = url;
|
audio.src = url;
|
||||||
}
|
}
|
||||||
audio.play()
|
playAudioWithFallback(audio, { deferOnIOS: options.deferOnIOS });
|
||||||
.then(() => setIsPlaying(true))
|
|
||||||
.catch(e => {
|
|
||||||
console.warn("Auto-play prevented:", e);
|
|
||||||
setIsPlaying(false);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -10,16 +10,32 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 音乐 API 代理 (解决 HTTPS 握手和 Host 问题)
|
||||||
|
location /music-api {
|
||||||
|
# 将 /music-api 映射到 /api
|
||||||
|
# 例如: /music-api?source=... -> https://music-dl.sayqz.com/api?source=...
|
||||||
|
rewrite ^/music-api/?(.*)$ /api/$1 break;
|
||||||
|
|
||||||
|
proxy_pass https://music-dl.sayqz.com;
|
||||||
|
|
||||||
|
# [关键] 开启 SSL Server Name Indication (SNI),否则 HTTPS 握手会失败
|
||||||
|
proxy_ssl_server_name on;
|
||||||
|
|
||||||
|
# [关键] 设置正确的 Host 头,或者直接删掉这行让 Nginx 自动使用 proxy_pass 的域名
|
||||||
|
# 千万不要设置为 $host,因为对方服务器不认识你的域名
|
||||||
|
proxy_set_header Host music-dl.sayqz.com;
|
||||||
|
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
|
||||||
# 同步服务 API 代理
|
# 同步服务 API 代理
|
||||||
# 将 /api/kv/... 转发到 sync-service 的 7482 端口
|
|
||||||
# 注意:这里去掉了 /api 前缀,因为 sync-service 直接监听 /kv
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://127.0.0.1:7482/;
|
proxy_pass http://127.0.0.1:7482/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
# 允许跨域 (如果前端和后端不在同一个域)
|
|
||||||
add_header 'Access-Control-Allow-Origin' '*';
|
add_header 'Access-Control-Allow-Origin' '*';
|
||||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||||
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
|
||||||
|
|||||||
@@ -32,6 +32,16 @@ const server = http.createServer((req, res) => {
|
|||||||
const parsedUrl = url.parse(req.url, true);
|
const parsedUrl = url.parse(req.url, true);
|
||||||
const pathname = parsedUrl.pathname;
|
const pathname = parsedUrl.pathname;
|
||||||
|
|
||||||
|
// --- Music API Proxy ---
|
||||||
|
// Proxy requests to music-dl.sayqz.com to avoid CORS issues
|
||||||
|
// if (pathname === '/music-api' || pathname === '/music-api/') {
|
||||||
|
// const queryString = parsedUrl.search || '';
|
||||||
|
// const targetUrl = `https://music-dl.sayqz.com/api/${queryString}`;
|
||||||
|
|
||||||
|
// proxyRequest(targetUrl, req, res);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
// Path format: /kv/:key?token=...
|
// Path format: /kv/:key?token=...
|
||||||
const match = pathname.match(/^\/kv\/([a-zA-Z0-9_-]+)$/);
|
const match = pathname.match(/^\/kv\/([a-zA-Z0-9_-]+)$/);
|
||||||
|
|
||||||
@@ -298,6 +308,224 @@ function downloadFile(url, dest) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// --- Music API Proxy Function ---
|
||||||
|
function proxyRequest(targetUrl, req, res) {
|
||||||
|
const parsedTarget = url.parse(targetUrl, true);
|
||||||
|
const requestType = parsedTarget.query && parsedTarget.query.type;
|
||||||
|
const isPicRequest = requestType === 'pic';
|
||||||
|
const isUrlRequest = requestType === 'url';
|
||||||
|
const maxRedirects = 5;
|
||||||
|
|
||||||
|
const buildHeaders = () => {
|
||||||
|
const headers = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
||||||
|
'Accept': '*/*',
|
||||||
|
'Accept-Encoding': 'identity'
|
||||||
|
};
|
||||||
|
if (req.headers.range) headers['Range'] = req.headers.range;
|
||||||
|
if (req.headers['if-range']) headers['If-Range'] = req.headers['if-range'];
|
||||||
|
return headers;
|
||||||
|
};
|
||||||
|
|
||||||
|
const requestStream = (nextUrl, redirectCount = 0) => {
|
||||||
|
if (redirectCount > maxRedirects) {
|
||||||
|
res.writeHead(502, { 'Content-Type': 'application/json' });
|
||||||
|
res.end(JSON.stringify({ error: 'Too many redirects' }));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsedNext = url.parse(nextUrl);
|
||||||
|
const isHttps = parsedNext.protocol === 'https:';
|
||||||
|
const requestModule = isHttps ? https : http;
|
||||||
|
const options = {
|
||||||
|
hostname: parsedNext.hostname,
|
||||||
|
port: parsedNext.port || (isHttps ? 443 : 80),
|
||||||
|
path: parsedNext.path,
|
||||||
|
method: req.method,
|
||||||
|
headers: buildHeaders()
|
||||||
|
};
|
||||||
|
|
||||||
|
const proxyReq = requestModule.request(options, (proxyRes) => {
|
||||||
|
if (proxyRes.statusCode >= 300 && proxyRes.statusCode < 400 && proxyRes.headers.location) {
|
||||||
|
const resolved = url.resolve(nextUrl, proxyRes.headers.location);
|
||||||
|
proxyRes.resume();
|
||||||
|
requestStream(resolved, redirectCount + 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const headers = { ...proxyRes.headers };
|
||||||
|
delete headers['content-encoding'];
|
||||||
|
delete headers['transfer-encoding'];
|
||||||
|
res.writeHead(proxyRes.statusCode || 200, headers);
|
||||||
|
proxyRes.pipe(res);
|
||||||
|
});
|
||||||
|
|
||||||
|
proxyReq.on('error', (e) => {
|
||||||
|
console.error('[Proxy] Stream error:', e.message);
|
||||||
|
res.writeHead(502, { 'Content-Type': 'application/json' });
|
||||||
|
res.end(JSON.stringify({ error: 'Proxy stream failed', message: e.message }));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (req.method === 'POST') {
|
||||||
|
req.pipe(proxyReq);
|
||||||
|
} else {
|
||||||
|
proxyReq.end();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
hostname: parsedTarget.hostname,
|
||||||
|
port: 443,
|
||||||
|
path: parsedTarget.path,
|
||||||
|
method: req.method,
|
||||||
|
headers: buildHeaders()
|
||||||
|
};
|
||||||
|
|
||||||
|
if (isUrlRequest) {
|
||||||
|
const proxyReq = https.request(options, (proxyRes) => {
|
||||||
|
if (proxyRes.statusCode >= 300 && proxyRes.statusCode < 400 && proxyRes.headers.location) {
|
||||||
|
const resolved = url.resolve(targetUrl, proxyRes.headers.location);
|
||||||
|
proxyRes.resume();
|
||||||
|
requestStream(resolved, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const contentType = proxyRes.headers['content-type'] || '';
|
||||||
|
const shouldInspectBody = contentType.includes('application/json') || contentType.startsWith('text/');
|
||||||
|
|
||||||
|
if (shouldInspectBody) {
|
||||||
|
let body = '';
|
||||||
|
proxyRes.setEncoding('utf8');
|
||||||
|
proxyRes.on('data', chunk => body += chunk);
|
||||||
|
proxyRes.on('end', () => {
|
||||||
|
try {
|
||||||
|
const parsedBody = JSON.parse(body);
|
||||||
|
const extractUrl = (payload) => {
|
||||||
|
if (!payload || typeof payload !== 'object') return null;
|
||||||
|
if (typeof payload.url === 'string') return payload.url;
|
||||||
|
if (typeof payload.data === 'string') return payload.data;
|
||||||
|
if (payload.data && typeof payload.data === 'object') {
|
||||||
|
if (typeof payload.data.url === 'string') return payload.data.url;
|
||||||
|
if (typeof payload.data.link === 'string') return payload.data.link;
|
||||||
|
if (payload.data.data && typeof payload.data.data.url === 'string') return payload.data.data.url;
|
||||||
|
if (Array.isArray(payload.data) && payload.data[0] && typeof payload.data[0].url === 'string') {
|
||||||
|
return payload.data[0].url;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (payload.result && typeof payload.result.url === 'string') return payload.result.url;
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
const resolvedUrl = extractUrl(parsedBody);
|
||||||
|
if (resolvedUrl) {
|
||||||
|
requestStream(url.resolve(targetUrl, resolvedUrl), 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// fall through to return original body
|
||||||
|
}
|
||||||
|
|
||||||
|
res.writeHead(proxyRes.statusCode || 200, {
|
||||||
|
'Content-Type': proxyRes.headers['content-type'] || 'application/json'
|
||||||
|
});
|
||||||
|
res.end(body);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const headers = { ...proxyRes.headers };
|
||||||
|
delete headers['content-encoding'];
|
||||||
|
delete headers['transfer-encoding'];
|
||||||
|
res.writeHead(proxyRes.statusCode || 200, headers);
|
||||||
|
proxyRes.pipe(res);
|
||||||
|
});
|
||||||
|
|
||||||
|
proxyReq.on('error', (e) => {
|
||||||
|
console.error('[Proxy] Request error:', e.message);
|
||||||
|
res.writeHead(502, { 'Content-Type': 'application/json' });
|
||||||
|
res.end(JSON.stringify({ error: 'Proxy request failed', message: e.message }));
|
||||||
|
});
|
||||||
|
|
||||||
|
if (req.method === 'POST') {
|
||||||
|
req.pipe(proxyReq);
|
||||||
|
} else {
|
||||||
|
proxyReq.end();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const proxyReq = https.request(options, (proxyRes) => {
|
||||||
|
const passThrough = () => {
|
||||||
|
const headers = { ...proxyRes.headers };
|
||||||
|
delete headers['content-encoding'];
|
||||||
|
delete headers['transfer-encoding'];
|
||||||
|
|
||||||
|
res.writeHead(proxyRes.statusCode, headers);
|
||||||
|
proxyRes.pipe(res);
|
||||||
|
};
|
||||||
|
|
||||||
|
// pic endpoint now returns JSON, turn it into a redirect for <img>
|
||||||
|
if (isPicRequest) {
|
||||||
|
if (proxyRes.statusCode >= 300 && proxyRes.statusCode < 400 && proxyRes.headers.location) {
|
||||||
|
res.writeHead(302, { Location: proxyRes.headers.location });
|
||||||
|
proxyRes.resume();
|
||||||
|
res.end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const contentType = proxyRes.headers['content-type'] || '';
|
||||||
|
if (contentType.startsWith('image/')) {
|
||||||
|
passThrough();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let body = '';
|
||||||
|
proxyRes.setEncoding('utf8');
|
||||||
|
proxyRes.on('data', chunk => body += chunk);
|
||||||
|
proxyRes.on('end', () => {
|
||||||
|
try {
|
||||||
|
const parsedBody = JSON.parse(body);
|
||||||
|
if (parsedBody && parsedBody.url) {
|
||||||
|
res.writeHead(302, { Location: parsedBody.url });
|
||||||
|
res.end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// fall through
|
||||||
|
}
|
||||||
|
|
||||||
|
res.writeHead(proxyRes.statusCode || 200, {
|
||||||
|
'Content-Type': proxyRes.headers['content-type'] || 'application/json'
|
||||||
|
});
|
||||||
|
res.end(body);
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle redirects
|
||||||
|
if (proxyRes.statusCode >= 300 && proxyRes.statusCode < 400 && proxyRes.headers.location) {
|
||||||
|
// For redirects, return the redirect URL to client
|
||||||
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||||
|
res.end(JSON.stringify({ url: proxyRes.headers.location }));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
passThrough();
|
||||||
|
});
|
||||||
|
|
||||||
|
proxyReq.on('error', (e) => {
|
||||||
|
console.error('[Proxy] Request error:', e.message);
|
||||||
|
res.writeHead(502, { 'Content-Type': 'application/json' });
|
||||||
|
res.end(JSON.stringify({ error: 'Proxy request failed', message: e.message }));
|
||||||
|
});
|
||||||
|
|
||||||
|
// Forward request body for POST requests
|
||||||
|
if (req.method === 'POST') {
|
||||||
|
req.pipe(proxyReq);
|
||||||
|
} else {
|
||||||
|
proxyReq.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function writeMetadata(inputPath, outputPath, metadata) {
|
function writeMetadata(inputPath, outputPath, metadata) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const args = ['-i', inputPath];
|
const args = ['-i', inputPath];
|
||||||
|
|||||||
Reference in New Issue
Block a user