搬运于https://github.com/Gunale0926/KO-ON-Bot 的仓库,对部分bug进行修复,完善文档。
-
直接下载Release版本的Win_with_environment.zip并解压
-
修改
config.json
文件,完善各平台cookie(可选),默认网易云平台可不用修改token*
: KOOK Bot token for bot *default_platform*
(Optional): Default Platform for Bot *n_*
: configs for Netease Musicb_*
: configs for Bilibiliqq_enable
: 1 or 0q_*
: configs for QQ Musicschedule_*
: configs for scheduler(refer to the template)
-
启动
./run.bat
Linux下部署,各系统具体基础环境有差异,这里以阿里云centos7.9为例。
- 安装Python3.10、nodejs、pip、yarn等前置环境
必须安装3.10版本,如未能成功安装,请自行搜索安装python3.10
可参考https://www.bilibili.com/read/cv15970563/
yum install -y python3.10 //此处若出错,看上面👆
yum install -y nodejs
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
yum install -y yarn
yum install -y screen
-
手动编译安装FFmpeg、libopus、libzmq(ffmpeg库不自带opus编码器和zmq,需手动编译安装)
-
libops
wget https://archive.mozilla.org/pub/opus/opus-1.3.1.tar.gz tar xzvf opus-1.3.1.tar.gz cd opus-1.3.1 ./configure make && make install
-
libzmq
wget https://github.com/zeromq/libzmq/releases/download/v4.3.4/zeromq-4.3.4.tar.gz tar xzvf zeromq-4.3.4.tar.gz cd zeromq-4.3.4 ./configure make && make install
-
ffmpeg
wget http://www.ffmpeg.org/releases/ffmpeg-4.3.2.tar.gz tar -xvf ffmpeg-4.3.2.tar.gz cd ffmpeg-4.3.2/ ./configure --enable-libopus --enable-libzmq //此步报错看最下面备注 make && make install
-
下载该项目
git clone https://github.com/qq704361748/KO-ON-BOT.git cd KO-ON-BOT python3 -m pip install -r requirements.txt //该步骤若有警告或报错,尝试指定镜像源👇,如下
python3 -m pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
-
下载咪咕、QQ音乐、网易云所需环境,切换到对应的目录
NeteaseCloudMusicApi
QQMusicApi
MiguMusicApi
,执行yarn install
cd NeteaseCloudMusicApi yarn install cd QQMusicApi yarn install cd MiguMusicApi yarn install
-
- 修改
config.json
文件,完善各平台cookie(可选),默认网易云平台可不用修改 - 启动
./run.sh
备注:
- 如出现
ERROR: opus not found using pkg-config
的报错,输入export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:"/usr/local/lib/pkgconfig"
然后再继续。 - 如出现
nasm/yasm not found or too old
的报错,输入yum -y install nasm
然后再继续。 - 运行core.py点歌中可能会出现
ffmpeg: error while loading shared libraries: libzmq.so.5: cannot open shared object file: No such file or directory
的报错,可以采用以下方法解决在 /etc/ld.so.conf.d/ 目录中创建一个
libzmq.conf
文件,文件内容添加/usr/local/lib
; 保存后输入sudo ldconfig
更新库缓存