当前位置:网站首页>You get download the installation and use of artifact
You get download the installation and use of artifact
2022-06-12 08:08:00 【HNU_ Liu Yuan】
you-get
brief introduction
You-Get Is a very small command line program , Media content can be downloaded from the website ( video , Audio , Images ). Specific uses are :
- from B standing , Iqiyi , Download videos from popular websites such as Netease cloud music / Audio .
- Download by crawling the web page ( Interested in ) Images .
- Streaming online video in media players .
- Crawl most 300 strip B Stand in the barrage
Installation method
Depend on the environment :
- Python 3.2 Or more
- FFmpeg 1.0 Or more
python You can refer to other blogs for the installation of , Proposed installation python3.7
among FFmpeg Download interface :FFmpeg download
Method 1: adopt pip
You can install it directly from the command line :
pip3 install you-get
Or install through image :
pip install you-get -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Method 2:Git clone
Even if you don't use it often Python Write code , This is also the recommended method for all developers .
git clone git://github.com/soimort/you-get.git
Then put the cloned directory into your PATH in , Or run ./setup.py install To install you-get To the permanent path .
verification
Enter at the command line :
you-get
If you get the following interface , The successful :
usage: you-get [OPTION]... URL...
A tiny downloader that scrapes the web
optional arguments:
-V, --version Print version and exit
-h, --help Print this help message and exit
Dry-run options:
(no actual downloading)
-i, --info Print extracted information
-u, --url Print extracted information with URLs
--json Print extracted URLs in JSON format
Download options:
-n, --no-merge Do not merge video parts
--no-caption Do not download captions (subtitles, lyrics, danmaku, ...)
-f, --force Force overwriting existing files
--skip-existing-file-size-check
Skip existing file without checking file size
-F STREAM_ID, --format STREAM_ID
Set video format to STREAM_ID
-O FILE, --output-filename FILE
Set output filename
-o DIR, --output-dir DIR
Set output directory
-p PLAYER, --player PLAYER
Stream extracted URL to a PLAYER
-c COOKIES_FILE, --cookies COOKIES_FILE
Load cookies.txt or cookies.sqlite
-t SECONDS, --timeout SECONDS
Set socket timeout
-d, --debug Show traceback and other debug info
-I FILE, --input-file FILE
Read non-playlist URLs from FILE
-P PASSWORD, --password PASSWORD
Set video visit password to PASSWORD
-l, --playlist Prefer to download a playlist
-a, --auto-rename Auto rename same name different files
-k, --insecure ignore ssl errors
Proxy options:
-x HOST:PORT, --http-proxy HOST:PORT
Use an HTTP proxy for downloading
-y HOST:PORT, --extractor-proxy HOST:PORT
Use an HTTP proxy for extracting only
--no-proxy Never use a proxy
-s HOST:PORT or USERNAME:[email protected]:PORT, --socks-proxy HOST:PORT or USERNAME:[email protected]:PORT
Use an SOCKS5 proxy for downloading
It also contains the available parameters and commands .
One of the more important ones is :
| Options | explain |
|---|---|
| -i | Display resource information , For example, format 、 clarity 、 Size, etc |
| -u | Specify which to download or view url, Sometimes you can omit -u Add directly url |
| -o | Set the output folder , That is, save the path , If not specified , Save in the current working directory |
| -O | Set file name , You can use the default file name |
| -f | Force overwrite of existing files |
| -l | Download the whole list first |
| -P | Use password ( If you need a password to access the video ) |
| -t | Set timeout , The unit is seconds |
| -c | Use cookie, load cookies.txt perhaps cookies.sqlite |
upgrade
Upgrade through the following command line :
pip install --upgrade you-get
uninstall
The uninstallation instructions are similar to others :
pip uninstall you-get
Video downloading
B Station video download
Need to use --info/-i Option to see all available qualities and formats :
Enter at the command line :
you-get -i ' Video link '
With B Station video as an example :
you-get -i 'https://www.bilibili.com/video/BV1iz4y1m7KF?spm_id_from=333.851.b_62696c695f7265706f72745f6469676974616c.46'
You get the following interface :
It contains the format of the video that can be downloaded , stay
# download-with: you-get --format=flv [URL]
There is a prompt to download the method , In the above flv For example, video :
you-get --format=flv 'https://www.bilibili.com/video/BV1iz4y1m7KF?spm_id_from=333.851.b_62696c695f7265706f72745f6469676974616c.46'

View in folder , Download to the home folder by default .
In addition to video files , And downloaded 300 strip B Stand in the barrage .
Set the path and name of the download file
Use –output-dir/-o Option set path , And use –output-filename/-O Set the name of the download file , example :
you-get -o ~/Videos -O videos ' Video link '
Streaming online video in media players
Use –player/-p Option to input video into the media player of your choice , for example mpv or vlc, Instead of downloading it :
you-get -p vlc ' Video link '
perhaps , If you want to watch the video in your browser , And there's no advertising or comment section :
you-get -p chromium ' Video link '
After my own tests , utilize ubuntu On the Internet , Reactive , A window is opened but an error is reported , May and B The station's strategy .
Music download
After actual measurement and Official forms ,QQ Music cannot be downloaded for the time being .
Take Netease cloud music for example :
Command line input :
you-get -i 'https://music.163.com/#/song?id=1804797118'
You can get specific information :
Because there is only one version , So the default download is OK :
you-get 'https://music.163.com/#/song?id=1804797118'
obtain :
Download the lyrics and songs at the same time :
Images are downloaded
from Official forms Look at , There are not many domestic websites that support image downloading , Only B standing 、 Baidu tieba and Kwai .
Take the address of the picture as an example :
you-get -i 'https://w.wallhaven.cc/full/72/wallhaven-7232p9.jpg'
Get the information , On behalf of success :
Download input command line :
you-get 'https://w.wallhaven.cc/full/72/wallhaven-7232p9.jpg'
The download is complete .
Automatically search for downloaded videos
You can pass anything to you-get. If the URL is invalid ,you-get There will be Google Search and download the most relevant videos for you .( This may not be exactly what you want to see , But it is still possible .)
The example given on the official website is :
you-get "Richard Stallman eats"
But I didn't succeed , I don't know why .
python Code batch download
Just put the video you want to download on urls In the list ,path Change to the address you want to save , You can download in batches .
Thanks for the comments area That autumn Leaving a message. : The download link is enclosed in double quotation marks , Not single quotes .
# !/usr/bin/env python
# -*-coding:utf-8-*-
import sys
import you_get
# urls_list
urls = ["https://www.bilibili.com/video/BV1iz4y1m7KF?spm_id_from=333.851.b_62696c695f7265706f72745f6469676974616c.48",
"https://www.bilibili.com/video/BV1qV411t7ma/?spm_id_from=333.788.recommend_more_video.2",
"https://www.bilibili.com/video/BV1pv411e7Cd/?spm_id_from=333.788.recommend_more_video.5"]
def download(url, path):
sys.argv = ['you-get', '-o', path, url]
you_get.main()
if __name__ == '__main__':
# The location of the video output
path = '/home/ video '
for i in range(len(urls)):
download(urls[i], path)
Try to run... From the command line , The compiler doesn't know why it reports an error , such as :
python youget.py
The effect is as follows :

Conclusion
In short, it is very easy to use .
The above is all shared , The official link is as follows :GitHub
边栏推荐
- 20220526 yolov1-v5
- Three data exchange modes: line exchange, message exchange and message packet exchange
- The Poisson regression model (posion) is constructed by GLM function of R language, and the poisgof function of epidisplay package is used to test the goodness of fit of the fitted Poisson regression
- 2.1 linked list - remove linked list elements (leetcode 203)
- Some summaries of mathematical modeling competition in 2022
- Rich dad, poor dad Abstract
- EasyExcel导出Excel表格到浏览器,并通过Postman测试导出Excel【入门案例】
- 20220524 backbone deep learning network framework
- Face recognition using BP neural network of NNET in R language
- 20220524 deep learning technology points
猜你喜欢

(P36-P39)右值和右值引用、右值引用的作用以及使用、未定引用类型的推导、右值引用的传递

"Three.js" auxiliary coordinate axis

Topic 1 Single_ Cell_ analysis(2)

Improvement of hash function based on life game (continued 2)

MATLAB image processing - Otsu threshold segmentation (with code)

Cookies and sessions

Vision Transformer | Arxiv 2205 - LiTv2: Fast Vision Transformers with HiLo Attention

Ten important properties of determinant

MATLAB image processing -- image transformation correction second-order fitting

2021.11.3-7 scientific research log
随机推荐
The R language converts the data of the specified data column in the dataframe data from decimal to percentage representation, and the data to percentage
20220526 loss function
The project file contains toolsversion= "14.0". This toolset may be unknown or missing workarounds
The R language uses the sample The split function divides the machine learning data set into training set and test set
Talk about the four basic concepts of database system
从AC5到AC6转型之路(1)——补救和准备
MATLAB image processing - cosine noise removal in image (with code)
20220526 yolov1-v5
El expression and JSTL
How to standardize the creation of a pytorch project
KAtex problem of vscade: parseerror: KAtex parse error: can't use function '$' in math mode at position
Leetcode notes: Weekly contest 275
Compiling principle on computer -- functional drawing language (IV): semantic analyzer
visual studio2019的asp.net项目添加日志功能
Rich dad, poor dad Abstract
Visual studio code batch comment and uncomment
电脑连接上WiFi但是上不了网
Kalman filter encapsulation function
模型压缩 | TIP 2022 - 蒸馏位置自适应:Spot-adaptive Knowledge Distillation
Dynamic simulation method of security class using Matlab based Matpower toolbox