安装
参考:
https://blog.csdn.net/phachon/article/details/52514380
https://blog.csdn.net/qq_40608730/article/details/113702538
# 安装 python
sudo apt-get install python3-pip
# 安装 you-get
sudo pip3 install you-get
# 最终安装到了
/home/cb1000n/.local/bin
使用
参考:
https://www.bilibili.com/video/BV1b54y147hR
https://www.bilibili.com/video/BV1yy4y1h7wJ
下载单个视频
[email protected]:~/test$ you-get --no-caption https://www.bilibili.com/video/BV1w54y1e71X?p=1
you-get: This is a multipart video. (use --playlist to download all parts.)
site: Bilibili
title: 这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版)
stream:
- format: dash-flv
container: mp4
quality: 高清 1080P
size: 30.6 MiB (32111057 bytes)
# download-with: you-get --format=dash-flv [URL]
Downloading 这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版).mp4 ...
100% ( 30.6/ 30.6MB) ├██████████████████████████████████████████████████████████████┤[2/2] 13 MB/s
Merging video parts... Merged into 这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版).mp4
Skipping captions or danmaku.
[email protected]:~/test$ ls
'这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版).mp4'
下载播放列表
[email protected]:~/test$ you-get --playlist --no-caption https://www.bilibili.com/video/BV1w54y1e71X?p=1
site: Bilibili
title: 这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版)
stream:
- format: dash-flv
container: mp4
quality: 高清 1080P
size: 30.6 MiB (32111057 bytes)
# download-with: you-get --format=dash-flv [URL]
Downloading 这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版).mp4 ...
100% ( 30.6/ 30.6MB) ├██████████████████████████████████████████████████████████████┤[2/2] 12 MB/s
Merging video parts... Merged into 这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版).mp4
Skipping captions or danmaku.
site: Bilibili
title: 这TM是人跳的?【两只老虎爱跳舞真人版】 (P2. 两只老虎纯享版)
stream:
- format: dash-flv
container: mp4
quality: 高清 1080P
size: 14.6 MiB (15357306 bytes)
# download-with: you-get --format=dash-flv [URL]
Downloading 这TM是人跳的?【两只老虎爱跳舞真人版】 (P2. 两只老虎纯享版).mp4 ...
100% ( 14.6/ 14.6MB) ├██████████████████████████████████████████████████████████████┤[2/2] 9 MB/s
Merging video parts... Merged into 这TM是人跳的?【两只老虎爱跳舞真人版】 (P2. 两只老虎纯享版).mp4
Skipping captions or danmaku.
[email protected]:~/test$ ls
'这TM是人跳的?【两只老虎爱跳舞真人版】 (P1. 两只老虎爱跳舞完整版).mp4'
'这TM是人跳的?【两只老虎爱跳舞真人版】 (P2. 两只老虎纯享版).mp4'
使用手册
参考:
https://www.cnblogs.com/zwgbk/p/10238489.html
you-get使用手册 | |
---|---|
可选参数: | |
-V, --version | 查看版本并退出 |
-h, --help | 查看帮助信息 |
不影响使用的选项: | |
-i, --info | 查看页面视频信息 |
-u, --url | 查看页面视频信息包括解析的url地址 |
–json | 以json格式查看页面视频信息 |
下载选项: | |
-n, --no-merge | 不合并视频 |
–no-caption | 不下载字幕 |
-f, --force | 强制覆盖现有文件 |
-F STREAM_ID, --format STREAM_ID | 指定视频的格式 |
-O FILE, --output-filename FILE | 指定下载的文件名称 |
-o DIR, --output-dir DIR | 指定下载文件的目录 |
-p PLAYER, --player PLAYER | 把视频流输出到指定的播放器 |
-c COOKIES_FILE, --cookies COOKIES_FILE | 加载cookie文件 |
-t SECONDS, --timeout SECONDS | 设置超时时间 |
-d, --debug | 显示跟踪、调试信息 |
-I FILE, --input-file FILE | 从文件读取url列表 |
-P PASSWORD, --password PASSWORD | 指定加密视频的密码 |
-l, --playlist | 显示可以下载的列表 |
-a, --auto-rename | 自动重命名相同的名称不同的文件 |
代理选项: | |
-x HOST:PORT, --http-proxy HOST:PORT | 使用http代理下载 |
-y HOST:PORT, --extractor-proxy HOST:PORT | 仅抓取数据时使用http代理 |
–no-proxy | 关闭代理 |
-s HOST:PORT, --socks-proxy HOST:PORT | 使用socks5代理进行下载 |