教程来自:蓝瘦香菇大佬分享
源码来自
-> https://github.com/Binaryify/NeteaseCloudMusicApi (感谢Binaryify)
-> https://github.com/qier222/YesPlayMusic (感谢qier222)
#安装node.js LTS (v14.x) curl -sL https://deb.nodesource.com/setup_lts.x | bash - apt-get install -y nodejs #安装网易云音乐API git clone https://github.com/Binaryify/NeteaseCloudMusicApi.git cd NeteaseCloudMusicApi npm install #运行网易云音乐API(可以通过nohup screen supervisor等后台运行) cd NeteaseCloudMusicApi PORT=3000 HOST=0.0.0.0 node app.js #安装yarn curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list apt-get update && apt-get install -y yarn #安装YesPlayMusic git clone https://github.com/qier222/YesPlayMusic.git cd YesPlayMusic yarn install cp .env.example .env #假设上述网易云音乐API解析到了music.example.com sed -i 's/127.0.0.1/music.example.com/g' ./.env yarn run build #将 /dist 目录下的文件上传到你的 Web 服务器(不限制本机)
如果顺利搭建完成加载不出来页面,服务器端ping一下music.163.com。
如果不通,找个能ping通的ip,然后修改/etc/hosts即可