所要下载的B站视频链接地址: 被新垣结衣狂撩6分钟,这谁顶得住…
代码展示:
import os
url = r'"https://www.bilibili.com/video/BV1h4411V7oF"'
savePath = r'F:\bilibili_video_download'
command = 'you-get -o ' + savePath + ' ' + url
print("打印命令:\n",command,sep='')
os.system(command)
运行过程展示:
控制台输出:
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
尝试新的跨平台 PowerShell https://aka.ms/pscore6
加载个人及系统配置文件用了 923 毫秒。
(base) PS F:\spiders4cxq\bilibili\download_vip_video> conda activate web_crawler
(web_crawler) PS F:\spiders4cxq\bilibili\download_vip_video> & 'D:\Anaconda3\envs\web_crawler\python.exe' 'c:\Users\chenxuqi\.vscode\extensions\ms-python.python-2021.6.944021595\pythonFiles\lib\python\debugpy\launcher' '63900' '--' 'f:\spiders4cxq\bilibili\download_vip_video\download_single.py'
打印命令:
you-get -o F:\bilibili_video_download "https://www.bilibili.com/video/BV1h4411V7oF"
site: Bilibili
title: 被新垣结衣狂撩6分钟,这谁顶得住…
stream:
- format: flv
container: flv
quality: 高清 1080P
size: 90.8 MiB (95210318 bytes)
# download-with: you-get --format=flv [URL]
Downloading 被新垣结衣狂撩6分钟,这谁顶得住….flv ...
100% ( 90.8/ 90.8MB) ├████████████████████████████████████████┤[1/1] 4 MB/s
Downloading 被新垣结衣狂撩6分钟,这谁顶得住….cmt.xml ...
(web_crawler) PS F:\spiders4cxq\bilibili\download_vip_video>
程序执行结果:
指定文件下完成视频文件的下载: