VPS指南:【旧版】解锁网易云灰色歌曲之服务器端搭建

本文最后更新于:2023年7月9日 凌晨

UnblockNeteaseMusic是一款可以让网易云曲库里的灰色歌曲能够正常播放的神器。

项目地址:https://github.com/nondanee/UnblockNeteaseMusic

已经过时,请查看《VPS指南:【新版】解锁网易云灰色歌曲之服务器端搭建》

安装nodejs

其中16为版本。可以替换成12 14 16.

1
2
3
4
5
6
7
# Using Ubuntu
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

# Using Debian, as root
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get install -y nodejs

使用node -v命令查看是否安装成功。

1
2
root@debian:~# node -v
v16.3.0

下载项目

使用 Git 克隆

1
2
git clone https://github.com/nondanee/UnblockNeteaseMusic.git #克隆项目仓库
cd UnblockNeteaseMusic #进入项目根目录

没有安装git的,使用下面命令安装:

1
2
3
4
5
# CentoS
yum install git

# debian or ubuntu
apt-get install git

【可选】使用node启动

使用nodejs就可以启动项目,nodejs但退出窗口就会停止。

运行项目

直接启动

1
2
cd UnblockNeteaseMusic #进入项目根目录
node app.js

我使用的启动命令如下,其中-e是iOS端网易云升级后听灰色歌曲所必须的,且必须要https而不是http

1
node app.js -s -e https://music.163.com

【可选】其他配置

开启严格模式

仅接受网易云音乐的流量,不接受其他的

1
node app.js -s

设置搜索的音源 (有序)

默认为 qq kuwo migu,排在越前优先级越高,启用越多网络开销越大

1
node app.js -o joox qq

使用自定义端口

默认为8080

1
node app.js -p 5000

我也不太懂的一些

使用 jixun 的反代服务器

1
node app.js -f 79.137.38.20

使用上游 http / https 代理

1
node app.js -u http://127.0.0.1:1080

【推荐】使用pm2启动项目

用nodejs不能一直在后台运行,关闭窗口就会中断进程。所以我喜欢用pm2来挂着运行。也可以使用supervisor和docker,但我尝试了,这样部署以后都不能在iOS端运行,暂时不明白为什么。

NPM是随同NodeJS一起安装的包管理工具,能解决NodeJS代码部署上的很多问题.由于新版的nodejs已经集成了npm,所以之前npm也一并安装好了。同样可以通过输入 “npm -v” 来测试是否成功安装。命令如下,出现版本提示表示安装成功.

1
2
3
4
5
6
7
8
# 全局安装pm2
npm install -g pm2
# 启动项目
pm2 start node -- app.js -e https://music.163.com -s
# 保存当前列表
pm2 save
# 开机启动
pm2 startup

之后的一些命令

1
2
3
4
5
6
pm2 list                # 列出当前应用
pm2 stop app.js # 停止 可以先通过pm2 list获取应用的名字(--name指定的)或者进程id
pm2 stop all # 停止所有
pm2 restart app.js # 重启
pm2 restart all # 重启所有
pm2 delete app.js # 关闭

【另一方法】使用docker启动项目

尝试了此方法,但无法在iOS使用,不明白为什么
直接使用此命令,省掉了git那一步下载:

1
docker run -d -p 8080:8080 nondanee/unblockneteasemusic -s -e https://music.163.com

之后使用docker ps查看进程,使用docker kill 进程数来杀死进程。
没有安装docker的,用下面命令安装:

1
2
3
4
5
# 官方脚本
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

# 也可以使用国内 daocloud 一键安装命令:
curl -sSL https://get.daocloud.io/docker | sh

测试 Docker 是否安装成功,输入以下指令,打印出以下信息则安装成功:

1
docker run hello-world

打印信息:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest


Hello from Docker!
This message shows that your installation appears to be working correctly.


To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.


To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash


Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/


For more examples and ideas, visit:
https://docs.docker.com/get-started/

iOS端配置

QuantumultX配置,本地节点[server_local]下面加入

1
2
# ip和端口改成你自己的,格式ip:port
http=你的ip:你的端口, fast-open=false, udp-relay=false, tag=解锁网易云音乐

其他客户端写法可参考:https://merlinblog.xyz/wiki/neteasemusic.html


VPS指南:【旧版】解锁网易云灰色歌曲之服务器端搭建
https://pawswrite.xyz/posts/55183.html
作者
Rainbow
发布于
2021年6月17日
许可协议