先安装you_get
pip install you_get
爬取代码,爬了个ASMR的,学习困了自我催眠
1 import sys 2 from you_get import common as you_get #导入you-get库 3 4 directory = r'D:\1' #设置下载目录 5 url = 'https://www.bilibili.com/video/av31066839?from=search&seid=10714408116447776973' #需要下载的视频地址 6 sys.argv = ['you-get','-o',directory,url] #sys传递参数执行下载,就像在命令行一样 7 you_get.main()