You-Get is a small command line utility for downloading media content (videos, audios, images) from the web in case there is no other convenient method. The following dependencies are required and must be installed separately unless you are using a prebuilt package or chocolate package on Windows:
Python 3
FFmpeg (highly recommended) or Libav (optional)
RTMPDump

Option 1: Install via pip The official you-get is released on PyPI and can be installed via
pip package manager installs easily from PyPI mirrors.
Please note that you must use the Python 3 version of pip:
$ pip3 install you-get
Option 2: Install via antigen Add the following line to your .zshrc:
antigen bundle soimort/you-get
Option 3: Download the exe (standalone) or 7z (including all dependencies) using a pre-built package (Windows only) from:
[https](https://github.com/soimort/you-get/releases/latest):[//github.com/soimort/you-get/releases/latest](https://github.com/soimort/you-get/releases/latest)。
Option 4: Download from GitHub You can download the stable (same as the latest version on PyPI) or the development (more fixes, unstable features) branch you-get.
Related recommendations: "Python Video Tutorial"
Unzip it and put the directory containing the you-get script into PATH. Alternatively, run
$ [sudo] python3 setup.py install
or
$ python3 setup.py install --user
to install you-get to a permanent path.
Option 5: Git Clone This is the recommended method for all developers, even if you don’t code in Python often.
$ git clone git://github.com/soimort/you-get.git
Then put the cloned directory into your directory PATH, or run ./setup.py install to install you-get to a permanent path.
Option 6: Use Chocolatey (Windows only)
> choco install you-get
Option 7: Homebrew (Mac only)
You can -Get easily installed via:
$ brew install you-get
Shell completion Completion definitions for Bash, Fish and Zsh can be found in contrib/completion. Please refer to your shell manual to learn how to exploit them.
Upgrade
Depending on the option you-get you choose to install, you can upgrade via:
$ pip3 install --upgrade you-get
or download the latest version via:
$ you-get https://github.com/soimort/you-get/archive/master.zip
Or use the chocolate package manager:
> choco upgrade you-get
To get the latest develop branch without littering the PIP, you can try:
$ pip3 install --upgrade git+https://github.com/soimort/you-get@develop
Use
When you receive a video you are interested in, you can use the --info/ -i option to see all available qualities and formats:
$ you-get -i 'https://www.youtube.com/watch?v=jNQXAC9IVRw'site: YouTube title: Me at the zoo streams: # Available quality and codecs[ DEFAULT ] _________________________________ - itag: 43container: webm quality: medium size: 0.5 MiB (564215 bytes) # download-with: you-get --itag=43 [URL]- itag: 18 container: mp4 quality: medium # download-with: you-get --itag=18 [URL]- itag: 5 container: flv quality: small # download-with: you-get --itag=5 [URL]- itag: 36 container: 3gp quality: small # download-with: you-get --itag=36 [URL]- itag: 17 container: 3gp quality: small # download-with: you-get --itag=17 [URL]
The formats marked DEFAULT are the ones you will get by default format. If this looks cool, you download it:
$ you-get 'https://www.youtube.com/watch?v=jNQXAC9IVRw' site: YouTube title: Me at the zoo stream: - itag: 43 container: webm quality: medium size: 0.5 MiB (564215 bytes) # download-with: you-get --itag=43 [URL] Downloading zoo.webm ... 100.0% ( 0.5/0.5 MB) ├████████████████████████████████████████┤[1/1] 7 MB/s Saving Me at the zoo.en.srt ...Done.
(If the YouTube video has any subtitles, they will be downloaded along with the video file in SubRip subtitle format.) Or if you prefer another format (mp4), just use the options you-get shows you:
$ you-get --itag=18 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
NOTE:
· At this point, most of our support sites generally do not implement format selection; in this case , the default format to download is the highest quality format.
·ffmpeg is a required dependency for downloading and joining multiple parts of a stream (e.g. on some sites like Youku), as well as videos in 1080p or high resolution YouTube videos.
If you-get don’t want to join the video part after downloading, please use the --no-merge/ -n option.
Download anything else
If you already have the URL of the resource you need, you can download it directly from:
$ you-get https://stallman.org/rms. Site: stallman.org Title: rms Type: JPEG Image (image/jpeg) Size: 0.06 MiB (66482 Bytes) Downloading rms.jpg ... 100.0% ( 0.1/0.1 MB) ├████████████████████████████████████████┤[1/1] 127 kB/s
Otherwise, you-get will scrape Take a web page and try to find out if there's anything interesting for you:
$ you-get http://kopasas.tumblr.com/post/69361932517 Site: Tumblr.com Title: kopasas Type: Unknown type (None) Size: 0.51 MiB (536583 Bytes) Site: Tumblr.com Title: tumblr_mxhg13jx4n1sftq6do1_1280 Type: Portable Network Graphics (image/png) Size: 0.51 MiB (536583 Bytes) Downloading tumblr_mxhg13jx4n1sftq6do1_1280.png ... 100.0% ( 0.5/0.5 MB) ├████████████████████████████████████████┤[1/1] 22 MB/s
Note:
This feature is an experimental and is far from perfect. It works best for scraping large images from popular sites like Tumblr and Blogger, but there's really no universal pattern that can be applied to any site on the internet.
Search in Google Video and download
You can pass anything you-get. If the URL is not a valid one, you-get will perform a Google search and download the most relevant video for you. (This may not be what you want to see, but it's still possible.)
$ you-get "Richard Stallman eats"
Pause and resume downloads You can use Ctrl C to interrupt a download. Temporary .download files remain in the output directory. The next time you-get is run with the same parameters, download progress will resume from the previous session. If the file is downloaded completely (the temporary .download extension has been removed), you-get will skip the download.
To force a re-download, use the --force/ -f option. (Warning: Doing so will overwrite any existing files or temporary files with the same name!)
Set the path and name of the downloaded file
Use --output- dir/ -o option sets the path, and --output-filename/ -O sets the name of the downloaded file:
$ you-get -o ~/Videos -O zoo.webm 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
Tips:
· If you encounter the default video title (which may contain the same name as the current shell / These options are useful when you encounter problems with operating system/file system incompatible special characters).
·These options are also useful if you write a script to batch download files and put them into a folder with a specified name.
Proxy Settings
You-get to specify the HTTP proxy to use via the --http-proxy/ -x option:
$ you-get -x 127.0.0.1:8087 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
但是,http_proxy默认情况下应用系统代理设置(即环境变量)。要禁用任何代理,请使用该--no-proxy选项。
提示:
如果你需要使用代理了很多(如果您的网络阻止某些网站),你可能希望使用you-get与proxychains并设置alias you-get="proxychains -q you-get"(Bash中)。
对于某些网站(例如优酷),如果您需要访问仅在中国大陆可用的一些视频,可以使用特定代理从网站提取视频信息:--extractor-proxy/ -y。
观看视频
使用--player/ -p选项将视频馈送到您选择的媒体播放器,例如mplayer或vlc,而不是下载:
$ you-get -p vlc 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
或者,如果您更喜欢在浏览器中观看视频,只需没有广告或评论部分:
$ you-get -p chromium 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
提示:
可以使用该-p选项来启动另一个下载管理器,例如you-get -p uget-gtk 'https://www.youtube.com/watch?v=jNQXAC9IVRw'
,尽管它们可能不能一起播放很好。
加载Cookie
并非所有视频都向任何人公开。如果您需要登录帐户以访问某些内容(例如,私人视频),则无法you-get通过--cookies/ -c选项向浏览器提供Cookie 。
注意:
到目前为止,我们支持两种格式的浏览器Cookie:Mozilla cookies.sqlite和Netscape cookies.txt。
重新使用提取的数据
使用--url/ -u获取从页面提取的可下载资源URL的列表。用于--json以JSON格式获取抽取数据的摘要。
The above is the detailed content of How to call youget in python. For more information, please follow other related articles on the PHP Chinese website!
Python: Automation, Scripting, and Task ManagementApr 16, 2025 am 12:14 AMPython excels in automation, scripting, and task management. 1) Automation: File backup is realized through standard libraries such as os and shutil. 2) Script writing: Use the psutil library to monitor system resources. 3) Task management: Use the schedule library to schedule tasks. Python's ease of use and rich library support makes it the preferred tool in these areas.
Python and Time: Making the Most of Your Study TimeApr 14, 2025 am 12:02 AMTo maximize the efficiency of learning Python in a limited time, you can use Python's datetime, time, and schedule modules. 1. The datetime module is used to record and plan learning time. 2. The time module helps to set study and rest time. 3. The schedule module automatically arranges weekly learning tasks.
Python: Games, GUIs, and MoreApr 13, 2025 am 12:14 AMPython excels in gaming and GUI development. 1) Game development uses Pygame, providing drawing, audio and other functions, which are suitable for creating 2D games. 2) GUI development can choose Tkinter or PyQt. Tkinter is simple and easy to use, PyQt has rich functions and is suitable for professional development.
Python vs. C : Applications and Use Cases ComparedApr 12, 2025 am 12:01 AMPython is suitable for data science, web development and automation tasks, while C is suitable for system programming, game development and embedded systems. Python is known for its simplicity and powerful ecosystem, while C is known for its high performance and underlying control capabilities.
The 2-Hour Python Plan: A Realistic ApproachApr 11, 2025 am 12:04 AMYou can learn basic programming concepts and skills of Python within 2 hours. 1. Learn variables and data types, 2. Master control flow (conditional statements and loops), 3. Understand the definition and use of functions, 4. Quickly get started with Python programming through simple examples and code snippets.
Python: Exploring Its Primary ApplicationsApr 10, 2025 am 09:41 AMPython is widely used in the fields of web development, data science, machine learning, automation and scripting. 1) In web development, Django and Flask frameworks simplify the development process. 2) In the fields of data science and machine learning, NumPy, Pandas, Scikit-learn and TensorFlow libraries provide strong support. 3) In terms of automation and scripting, Python is suitable for tasks such as automated testing and system management.
How Much Python Can You Learn in 2 Hours?Apr 09, 2025 pm 04:33 PMYou can learn the basics of Python within two hours. 1. Learn variables and data types, 2. Master control structures such as if statements and loops, 3. Understand the definition and use of functions. These will help you start writing simple Python programs.
How to teach computer novice programming basics in project and problem-driven methods within 10 hours?Apr 02, 2025 am 07:18 AMHow to teach computer novice programming basics within 10 hours? If you only have 10 hours to teach computer novice some programming knowledge, what would you choose to teach...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft






