Last update at :2024-05-28,Edit by888u
Tutorial: Using Youtube-dl downloadOnline video
Source: http://www.vmvps.com/install-youtube-dl-to-make-it-possible-to-download-online-video-possible.html
Many friends may be visiting vpsadd and bought a lot of cheap VPS, but they are often at a loss during later use and don’t know what to use these VPS for. Today I will introduce to you how to use VPS< a href="https://vpsping.com/archives/tag/youtube-dl" title="View all posts in Youtube-dl" target="_blank">Youtube-dlHow to download online videos. . From the name, Youtube-dl is designed to download Youtube videos, but in fact the websites it supports are far more than that. However, you may have better options, including online parsing and downloading services such as ClipConvert.cc, as well as browser plug-ins (Chrome is a Google product and does not allow plug-ins to provide Youtube downloading functions. FireFox is recommended). Weimo will not analyze the pros and cons here. I just think that from a purely download perspective, foreign VPSs are faster.
Use Youtube-dl to download online videos on VPS
1. Installation
youtube-dl requires Python
1.curl command download
sudo curl https://yt-dl.org/latest/youtube-dl -o /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl2.wget command download
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx /usr/local/bin/youtube-dl3.brew installation (under OSX)
brew install youtube-dl4.Use pip
sudo pip install youtube-dlIn addition, since high-definition videos on Youtube store video and audio separately, we need to additionally install the ffmpeg video codec/decoder to support merging video and audio; Note: Youtube-dl ffmpeg is called automatically, so all you need to do is install it! The installation method under Ubuntu 14.04 is as follows,
sudo apt-get install python-software-properties software-properties-common sudo apt-add-repository ppa:mc3man/trusty-media sudo apt-get update sudo apt-get install ffmpeg gstreamer0.10-ffmpeg2. Upgrade
sudo youtube-dl -UIf it was installed with pip, you can also update it directly with pip
sudo pip install -U youtube-dl3. Simple use
1. Get the video format
We know that there are often many formats for a video on Youtube, such as 36p, 720p, 1080p, etc. If you want to get the correct download link, you must first list these formats. Let's take the video "Wei Mo is watching" recently. "The Pretender" as an example
sudo youtube-dl -F https://www.youtube.com/watch?v=YkyT_7WZSH4Return to the following list
[youtube] YkyT_7WZSH4: Downloading webpage [youtube] YkyT_7WZSH4: Downloading video info webpage [youtube] YkyT_7WZSH4: Extracting video information [youtube] YkyT_7WZSH4: Downloading DASH manifest [youtube] YkyT_7WZSH4: Downloading DASH manifest [info] Available formats for YkyT_7WZSH4: format code extension resolution note 171 webm audio only DASH audio 102k, vorbis@128k (44100Hz), 20.66MiB 140 m4a audio only DASH audio 129k, m4a_dash container, aac @128k (44100Hz), 29.11MiB 160 mp4 256x144 DASH video 116k, avc1.42c00c, 13fps, video only, 24.95MiB 278 webm 256x144 DASH video 126k, webm container, vp9, 13fps, video only, 18.42MiB 133 mp4 426x240 DASH video 255k, avc1.4d4015, 25fps, video only, 56.04MiB 242 webm 426x240 DASH video 294k, vp9, 25fps, video only, 36.49MiB 243 webm 640x360 DASH video 526k, vp9, 25fps, video only, 66.81MiB 134 mp4 640x360 DASH video 624k, avc1.4d401e, 25fps, video only, 96.71MiB 244 webm 854x480 DASH video 978k, vp9, 25fps, video only, 117.09MiB 135 mp4 854x480 DASH video 1117k, avc1.4d401e, 25fps, video only, 189.85MiB 247 webm 1280x720 DASH video 2129k, vp9, 25fps, video only, 238.56MiB 136 mp4 1280x720 DASH video 2252k, avc1.4d401f, 25fps, video only, 376.08MiB 13 3gp unknown small 17 3gp 176x144 small, mp4a.40.2, mp4v.20.3 36 3gp 320x240 small, mp4a.40.2, mp4v.20.3 5 flv 400x240 small 43 webm 640x360 medium, vorbis, vp8.0 18 mp4 640x360 medium, mp4a.40.2, avc1.42001E 22 mp4 1280x720 hd720, mp4a.40.2, avc1.64001F (best)2.Download
The first column (format code) in the above results is the most important. For example, if I want to download the highest-definition 1280×720 version, then I need to select 136 (video) + 140 (audio) and use the following command. downloaded! (Note: + The previous ffmpeg will be automatically called here, that is, the video and audio will be automatically merged. This time, a certain amount of time will be added. If it is not troublesome, you can also come back and use the player to call the audio separately. The method is not detailed here. Discussed)
sudo youtube-dl -f 136+140 https://www.youtube.com/watch?v=YkyT_7WZSH4In addition, if you don’t want to check the version, you can directly download the highest-definition version, or you can directly use the following command
youtube-dl -f bestvideo+bestaudio https://www.youtube.com/watch?v=YkyT_7WZSH4If you need to use a proxy, you can add the "-proxy proxy ip: proxy port" parameter (note that within the quotation marks, there are double short horizontal lines before proxy, and WordPress displays a long but horizontal line)< /p>
Of course, Youtube-dl also has many ways to play with parameters, please refer to the official parameter description (transmission)
Recommended site search: registered domain name query, US and European cloud servers, multi-IP station group servers, virtual host rental, domain name expiration query, app server rental, domain name registration, network server rental, server, mainland China station group server ,
发表评论