This method is fairly stable in downloading videos. This is recommended rather than struggling with the video download service.
Since it operates on the command line, it is relatively easy to incorporate it as a function of the program.
youtube-dl is a ** command line ** program for downloading videos from YouTube.com and other sites.
Requires Python interpreter, versions 2.6, 2.7, 3.2+, platform independent. It works on Unix, Windows and macOS. It's in the public domain, so you can modify it, redistribute it, and use it however you like.
Used on the command line.
Format
youtube-dl [OPTIONS]YouTube video URL[URL...]
Example of use
$ youtube-dl https://www.youtube.com/watch?v=7wfUUZvybPY
[youtube] 7wfUUZvybPY: Downloading webpage
[download] Destination: How to Install YouTube-DL (Windows 10)-7wfUUZvybPY.mp4
[download] 100% of 14.28MiB in 00:09
option | Description |
---|---|
-u, --username USERNAME | YouTube account |
-p, --password PASSWORD | Account password. Enter interactively if omitted |
-o, --output TEMPLATE | Output file name template |
-s, --simulate | Just simulate, not actually download |
-t, --title | Set the output file name to the video title |
-g, --get-url | Display download URL |
Youtube-dl may not be usable if there is a change in YouTube. In that case, there is a mechanism to update.
youtube-Function of dl
sudo youtube-dl -U
If the above doesn't work, you can download, re-install, and update Homebrew and pip on Windows by:
For Homebrew
brew update
brew upgrade youtube-dl
For pip
sudo pip install youtube_dl -U
Windows
Windows users should download the .exe file (https://yt-dl.org/latest/youtube-dl.exe) and use it through PATH
.
Mac You can install it with Homebrew.
brew install youtube-dl
Alternatively, you can install it with MacPorts.
sudo port install youtube-dl
pip You can also use pip. https://pypi.org/project/youtube_dl/
sudo -H pip install --upgrade youtube_dl
Linux, MacOS, UNIX
When using curl
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
When using wget
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
that's all
Recommended Posts