爬取B站视频

时间:2022-09-13 15:29:13

先安装you_get

pip install you_get

爬取代码,爬了个ASMR的,学习困了自我催眠

 import sys
from you_get import common as you_get #导入you-get库 directory = r'D:\1' #设置下载目录
url = 'https://www.bilibili.com/video/av31066839?from=search&seid=10714408116447776973' #需要下载的视频地址
sys.argv = ['you-get','-o',directory,url] #sys传递参数执行下载,就像在命令行一样
you_get.main()