README.md: add –force-reinstall to pip because it is now necessary for upgrading from a VCS URL to work when the package version is unchanged (https://github.com/pypa/pip/issues/9397, https://github.com/pypa/pip/issues/5780)
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
You-Get
NOTICE (30 May 2022): Support for Python 3.5, 3.6 and 3.7 will eventually be dropped. (see details here)
NOTICE (8 Mar 2019): Read this if you are looking for the conventional “Issues” tab.
You-Get is a tiny command-line utility to download media contents (videos, audios, images) from the Web, in case there is no other handy way to do it.
Here’s how you use
you-getto download a video from YouTube:And here’s why you might want to use it:
What
you-getcan do for you:Interested? Install it now and get started by examples.
Are you a Python programmer? Then check out the source and fork it!
Installation
Prerequisites
The following dependencies are recommended:
Option 1: Install via pip
The official release of
you-getis distributed on PyPI, and can be installed easily from a PyPI mirror via the pip package manager: (Note that you must use the Python 3 version ofpip)Option 2: Install via Antigen (for Zsh users)
Add the following line to your
.zshrc:Option 3: Download from GitHub
You may either download the stable (identical with the latest release on PyPI) or the develop (more hotfixes, unstable features) branch of
you-get. Unzip it, and put the directory containing theyou-getscript into yourPATH.Alternatively, run
Or
to install
you-getto a permanent path. (And don’t omit the dot.representing the current directory)You can also use the pipenv to install the
you-getin the Python virtual environment.Option 4: Git clone
This is the recommended way for all developers, even if you don’t often code in Python.
Then put the cloned directory into your
PATH, or runpython -m pip install path/to/you-getto installyou-getto a permanent path.Option 5: Homebrew (Mac only)
You can install
you-geteasily via:Option 6: pkg (FreeBSD only)
You can install
you-geteasily via:Option 7: Flox (Mac, Linux, and Windows WSL)
You can install
you-geteasily via:Shell completion
Completion definitions for Bash, Fish and Zsh can be found in
contrib/completion. Please consult your shell’s manual for how to take advantage of them.Upgrading
Based on which option you chose to install
you-get, you may upgrade it via:or download the latest release via:
In order to get the latest
developbranch without messing up the PIP, you can try:Getting Started
Download a video
When you get a video of interest, you might want to use the
--info/-ioption to see all available quality and formats:By default, the one on the top is the one you will get. If that looks cool to you, download it:
(If a YouTube video has any closed captions, they will be downloaded together with the video file, in SubRip subtitle format.)
Or, if you prefer another format (mp4), just use whatever the option
you-getshows to you:Note:
ffmpegis a required dependency, for downloading and joining videos streamed in multiple parts (e.g. on some sites like Youku), and for YouTube videos of 1080p or high resolution.you-getto join video parts after downloading them, use the--no-merge/-noption.Download anything else
If you already have the URL of the exact resource you want, you can download it directly with:
Otherwise,
you-getwill scrape the web page and try to figure out if there’s anything interesting to you:Note:
Search on Google Videos and download
You can pass literally anything to
you-get. If it isn’t a valid URL,you-getwill do a Google search and download the most relevant video for you. (It might not be exactly the thing you wish to see, but still very likely.)Pause and resume a download
You may use Ctrl+C to interrupt a download.
A temporary
.downloadfile is kept in the output directory. Next time you runyou-getwith the same arguments, the download progress will resume from the last session. In case the file is completely downloaded (the temporary.downloadextension is gone),you-getwill just skip the download.To enforce re-downloading, use the
--force/-foption. (Warning: doing so will overwrite any existing file or temporary file with the same name!)Set the path and name of downloaded file
Use the
--output-dir/-ooption to set the path, and--output-filename/-Oto set the name of the downloaded file:Tips:
Proxy settings
You may specify an HTTP proxy for
you-getto use, via the--http-proxy/-xoption:However, the system proxy setting (i.e. the environment variable
http_proxy) is applied by default. To disable any proxy, use the--no-proxyoption.Tips:
you-getwith proxychains and setalias you-get="proxychains -q you-get"(in Bash).--extractor-proxy/-y.Watch a video
Use the
--player/-poption to feed the video into your media player of choice, e.g.mpvorvlc, instead of downloading it:Or, if you prefer to watch the video in a browser, just without ads or comment section:
Tips:
-poption to start another download manager, e.g.,you-get -p uget-gtk 'https://www.youtube.com/watch?v=jNQXAC9IVRw', though they may not play together very well.Load cookies
Not all videos are publicly available to anyone. If you need to log in your account to access something (e.g., a private video), it would be unavoidable to feed the browser cookies to
you-getvia the--cookies/-coption.Note:
cookies.sqliteand Netscapecookies.txt.Reuse extracted data
Use
--url/-uto get a list of downloadable resource URLs extracted from the page. Use--jsonto get an abstract of extracted data in the JSON format.Warning:
Supported Sites
ナナゴーゴー
ニコニコ動画
网易视频
网易云音乐
https://music.163.com/
百度贴吧
哔哩哔哩
爱奇艺
猫耳FM
腾讯视频
新浪视频
微博秒拍视频
https://video.weibo.com/
搜狐视频
土豆
优酷
네이버
https://video.zhibo.tv/
For all other sites not on the list, the universal extractor will take care of finding and downloading interesting resources from the page.
Known bugs
If something is broken and
you-getcan’t get you things you want, don’t panic. (Yes, this happens all the time!)Check if it’s already a known problem on https://github.com/soimort/you-get/wiki/Known-Bugs. If not, follow the guidelines on how to report an issue.
Getting Involved
You can reach us on the Gitter channel #soimort/you-get (here’s how you set up your IRC client for Gitter). If you have a quick question regarding
you-get, ask it there.If you are seeking to report an issue or contribute, please make sure to read the guidelines first.
Legal Issues
This software is distributed under the MIT license.
In particular, please be aware that
Translated to human words:
In case your use of the software forms the basis of copyright infringement, or you use the software for any other illegal purposes, the authors cannot take any responsibility for you.
We only ship the code here, and how you are going to use it is left to your own discretion.
Authors
Made by @soimort, who is in turn powered by
,
and
.
You can find the list of all contributors here.