0x01 Installation
pip3 install you-get
$ pip3 install --upgrade you-get
You-get command line, enter the following echo if the installation is successful
0x02 usage
Usage: you-get [OPTION]... [URL]...
Startup options:
-V | --version 版本信息
-h | --help 帮助
Dry-run options: (no actual downloading)
-i | --info 列出所有可获取的视频信息
-u | --url 打印URLs的提取出信息,真实链接地址
--json 打印URLs的JSON格式
Download options:
-n | --no-merge 不合并分片
--no-caption 不下载其他文件(字幕,歌词,弹幕。。。)
-f | --force 覆盖存在的文件
-F | --format <STREAM_ID> 选择下载那种清晰度的视频
-O | --output-filename <FILE> 设置输出文件名
-o | --output-dir <PATH> 输出文件夹(相对位置可用,如:~/video/)
-p | --player <PLAYER [OPTIONS]> 将提取出的真实地址传给播放器
-c | --cookies <COOKIES_FILE> 导入cookies.txt或cookies.sqlite(firefox下使用export-cookies插件)
-x | --http-proxy <HOST:PORT> 使用HTTP代理下载
-y | --extractor-proxy <HOST:PORT> 仅对真实地址视频文件的下载使用HTTP代理
--no-proxy 不使用代理
-s | --socks-proxy <HOST:PORT> 使用SOCKS5协议代理
-t | --timeout <SECONDS> 设置代理的timeout
-d | --debug 显示traceback和其他的debug信息
-I | --input-file 仅下载链接的视频不下载列表
0x03 test download
Test Address: https://www.youtube.com/watch?v=2DaXzST5aJg
View Details
You can view video details, such as quality, size, resolution, etc., you-get download 默认下载最高画质
!
you-get -i https://www.youtube.com/watch?v=2DaXzST5aJg
download
you-get https://www.youtube.com/watch?v=2DaXzST5aJg
Set output file name or path
using the --output-dir/-o
set path, --output-filename / -O set output file name:
ou-get -o ~/Videos -O zoo.mp4 'https://www.youtube.com/watch?v=2DaXzST5aJg'
Proxy settings
through -x
to you-get HTTP proxy settings:
you-get -x 127.0.0.1:8080 'https://www.youtube.com/watch?v=2DaXzST5aJg'
In short, as long as you give him he can give you a URL to download! ! !
Project Address: https://github.com/soimort/you-get