Linux VPS快速下载Bilibili视频脚本|支持1080P|720P|360P等格式

cera cera

使用

Github地址:https://github.com/Henryhaohao/Bilibili_video_download

由于Win系统下载工具非常多,所以就不说Win系统使用,这里就只说下Linux系统用法。

1、安装Python3

#CentOS系统
wget https://www.moerats.com/usr/shell/Python3/CentOS_Python3.6.sh && sh CentOS_Python3.6.sh
#Debian系统
wget https://www.moerats.com/usr/shell/Python3/Debian_Python3.6.sh && sh Debian_Python3.6.sh
#由于Ubuntu 16+自带Python3,所以只需要安装pip3就可以了
apt install python3-pip -y

2、安装ffmpeg

#下载ffmpeg二进制
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-$(getconf LONG_BIT)bit-static.tar.xz
#解压文件
tar xvf ffmpeg-git-*-static.tar.xz
#移动ffmpeg可执行文件
mv ffmpeg-git-*/ffmpeg  ffmpeg-git-*/ffprobe /usr/bin/
#删除文件
rm -rf ffmpeg-git-*

3、下载脚本

#下载脚本并存放在/root/bz文件夹
git clone https://github.com/Henryhaohao/Bilibili_video_download.git /root/bz
#安装依赖
cd /root/bz && pip3 install -r requirements.txt
#开始运行脚本
python3 bilibili_video_download.py

然后会要求你输入B站的AV号或者视频链接地址,然后选择你需要的格式,直到下载完成。

如果你运行脚本的时候出现UnicodeEncodeError: 'ascii' codec can't encode错误,那就需要先将系统的默认语言环境编码设置为UTF-8格式,使用命令:

echo 'export LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8' >> /etc/profile
source /etc/profile

最后下载的视频会存放/root/bz文件夹,不过好像下载的1080P视频清晰度比在线播放的稍微差一点点,不知道是不是看错了,不过还是挺清晰的,然后有需求的同学们可以下好后上传到OneDrive或者GoogleDrive网盘保存下。

cera cloudiplc tengxunyun

相关推荐

mjjping.com cera cera cloudiplc