you-get是一个极其好用的网页视频下载神器,支持几乎所有的你所见到的视频网站(当然也支持音频和图片的下载,但我们最常用来的是下载视频).这个工具完全使用命令行来操作,排斥者慎用.you-get使用python开发而成,要想使用必须先安装python,python安装好后,使用其自带的包管理器pip3下载安装you-get.由于网页视频是有一小段一小段组成的,所以下载下来的视频需要合并成完整的一个视频,这就需要用到另外一个开源影音编解码工具ffmpeg(如果用绿色版需要配置到系统环境变量里).
打开命令行,键入pip3 install you-get
一会就安装好了
以优酷上功守道为例:
键入you-get -i "http://v.youku.com/v_show/id_XMzE0ODM1ODg1Ng==.html?spm=a2hww.20027244.m_250379.5~1~3~A"
site: 优酷 (Youku)
title: 功守道
streams: # Available quality and codecs
[ DEFAULT ] _________________________________
- format: mp4hd3
container: mp4
video-profile: 1080P
size: 298.5 MiB (312992360 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=hd3&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=mp4hd3 [URL]
- format: mp4hd3v2
container: mp4
video-profile: 1080P
size: 297.9 MiB (312415230 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=hd3&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=mp4hd3v2 [URL]
- format: mp4hd2
container: mp4
video-profile: 超清
size: 167.5 MiB (175599142 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=hd2&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=mp4hd2 [URL]
- format: mp4hd2v2
container: mp4
video-profile: 超清
size: 166.9 MiB (175007509 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=hd2&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=mp4hd2v2 [URL]
- format: flvhd
container: flv
video-profile: 高清
size: 57.0 MiB (59794363 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=flv&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=flvhd [URL]
- format: mp4hd
container: mp4
video-profile: 高清
size: 104.7 MiB (109793046 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=mp4&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=mp4hd [URL]
- format: mp4sd
container: mp4
video-profile: 标清
size: 57.4 MiB (60208084 bytes)
m3u8_url: http://pl-ali.youku.com/playlist/m3u8?vid=XMzE0ODM1ODg1Ng%3D%3D&type=flv&ups_client_netip=223.72.86.112&ups_ts=1510582707&utid=r5eQEiwfozACAd9IVnCmj5aQ&ccode=0401&psid=6486cba4a1c8d52d6302082fb3171e3f&duration=1362&expire=18000&ups_key=c8df1682b212194e177de6e9513a5730
# download-with: you-get --format=mp4sd [URL]
audio-languages:
- lang: 国语
download-url: http://v.youku.com/v_show/id_XMzE0ODM1ODg1Ng==
会列出不同清晰度的视频信息,比如我们要下载mp4高清格式的,键入you-get -o F:\ --format=mp4hd3 "http://v.youku.com/v_show/id_XMzE0ODM1ODg1Ng==.html?spm=a2hww.20027244.m_250379.5~1~3~A"
然后会出现:
解释:-o表示下载路径 –format表示要下载的格式,如果需要设置代理,可以用-x [代理地址]例如:-x 127.0.0.1:1080
,简单入门就这些,如果需要学习更高级的命令请参考下面:
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
-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
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, –socks-proxy HOST:PORT
Use an SOCKS5 proxy for downloading
好了,如果有什么疑问可以在右上角的联系方式中联系我!