Skip to content

About

自建网易云热门评论 API,配合箭头音乐客户端的精彩点评服务使用。歌曲播放时下滑可查看该歌曲的网易云热门评论。

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

music-comments-api — 箭头音乐精彩点评服务

自建网易云热门评论 API,配合箭头音乐客户端使用。歌曲播放时下滑可查看该歌曲的网易云热门评论。

前置要求

请先根据以下项目内容搭建好网易云增强API

https://neteaseapi.gksm.store/docs/#/?id=neteasecloudmusicapienhanced

架构

网易云增强 API (服务器IP:3000)
       ↓ 搜索 / 获取评论
generate_comments.py (飞牛 NAS, cron 定时)
       ↓ 生成
comments_data.json
       ↓ 挂载
music-comments-api (Docker:8088)
       ↓ 反代
http://192.168.100.178:8088(填你的IP地址)
       ↓ 箭头音乐客户端接入

文件说明

comments-api/
├── README.md
├── Dockerfile                          # 容器构建文件
├── app.py                              # Flask API 服务(music-comments-api)
├── generate_comments.py                # 评论数据生成器
├── docker-compose.yml                  # 一键部署配置
└── 部署教程_评论API.txt                 # 详细部署步骤

快速部署

1. 生成评论数据

# 编辑 generate_comments.py 顶部 API_BASE 为你的增强 API 地址
API_BASE = "http://192.168.100.178:3000"

# 安装依赖(仅 MP3 需要 mutagen,FLAC 零依赖)
pip3 install mutagen --break-system-packages

# 运行(首次全量,之后增量只抓新歌)
python3 generate_comments.py "/vol1/1000/music" comments_data.json

2. 部署 Docker 容器

# 把 comments_data.json 放在项目目录
cp comments_data.json /vol1/1000/comments-api/

# 启动
cd /vol1/1000/comments-api
docker-compose up -d

本地验证:

curl http://localhost:8088/health
curl "http://localhost:8088/api/comment/list?song_name=晴天&singer_name=周杰伦"

3. 箭头音乐配置

设置 → 精彩点评 → 添加:

字段 值
名称 网易云评论
地址 http://192.168.100.178:8088
用户名 留空
密码 留空

4. 定时更新(每天凌晨 3 点)

crontab -e
0 3 * * * python3 /vol1/docker/music-comments/generate_comments.py "/vol1/1000/music" /vol1/1000/comments-api/comments_data.json

API 端点

端点 方法 说明
/ GET 健康检查 + 评论列表转发
/health GET 服务状态
/api/comment/list GET 获取指定歌曲的评论(?song_name=xxx&singer_name=yyy)
/api/comment/search GET 关键词搜索评论
/api/stats GET 评论统计
/api/songs GET 所有已获取评论的歌曲列表

依赖

依赖 用途
Docker 运行 music-comments-api 容器
Python 3.9+ 运行 generate_comments.py
网易云增强 API (VPS) 搜索歌曲 + 获取评论
mutagen MP3 标签读取(可选)

About

自建网易云热门评论 API,配合箭头音乐客户端的精彩点评服务使用。歌曲播放时下滑可查看该歌曲的网易云热门评论。

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages