python a small application: 1 line batch download video station B

python provides a powerful third-party libraries, such as you-get can be used to batch download video library video site below to download B station in Zhejiang University _Python programming (collection) , for example, to demonstrate how to operate.
First we need to install the you-get operation, the use pip install on it, we can refer to the blog How to pip install installation package from the watercress source for installation, the installation should pay attention to when using the name of the package into you-get.

Then we need to get a list of video url, the url can be obtained through a browser, we only need to open the video connection, the browser can enter the copy box, note that if we need to download the entire amount of the total video, you need to url question mark? The latter figure is removed. Url is copied to the red block in FIG.
Here Insert Picture Description
Then, we have to determine these directories stored video downloads, for example, I created a new folder in bilibili f drive, then this directory is F: \ bilibili We then enter the following code in cmd window you can download this collection of:

you-get --playlist -o F:\bilibili https://www.bilibili.com/video/av84506749

Next, it is to witness the miracle of the moment it! Of course, if you only need to download one video, as long as you remove the code above -playlist, then the url into a video complete url on it.

Published 178 original articles · won praise 9 · views 5535

Guess you like

Origin blog.csdn.net/weixin_41855010/article/details/104501338