Last update at :2024-05-18,Edit by888u
This article is suitable for friends who have a VPS server and like to download and save YouTube videos. YouTube-dl is a Python script that specializes in downloading YouTube videos. It can even download other videos such as Bilibili, Youku, iQiyi, etc. Videos on the website. Support multiple video formats such as MP4, 1080, etc. Support both Windows and Linux systems; this article mainly introduces the VPS Linux system building tutorial.
Install Python environment
First connect to the VPS through Xshell, because Yo
uTube-dl is written based on the Python language, so we must first install the Python library. Enter the following command on the command line of the Root user. Here I am using the Ubuntu 18 system:
apt install python3 python3-pipInstall ffmpeg decoding
Continue to enter the following commands on the command line:
apt update && apt install ffmpegBuild YouTube-dl
Here we directly use pip to install youtube-dl. It is not recommended to use apt to install. Enter the following command on the command line:
pip3 install youtube-dlAfter the command execution is completed, the installation is complete. You can enter: youtube-dl on the command line. The feedback will display the following help information and the installation is complete.
YouTube-dl use
1. The method of using youtube-dl to download videos is very simple. You only need to enter on the command line: youtube-dl plus the video URL, as shown below:
youtube-dl https://www.youtube.com/watch?v=uW_cKzFerQYThe above command will download the video directly to the current directory, as shown in the figure below:
2. You can also use the youtube-dl -F parameter plus the video address to check what formats this video has, as shown in the figure below:
3. We download a video in a separate format. Here I choose to download the mp4 720p video numbered 22. Use the youtube-dl -f 22 parameter and the video address to start downloading:
4. If you need to download multiple videos at once, we can use vi to create a txt text and enter the playback address of a YouTube video in each line:
The name of the txt file I created here is test.txt. Then we can use the youtube-dl -a parameter to download. If there are more videos to download, errors will inevitably occur. At this time, we can add the -i parameter. Ignore the parameters, enter the command line and start the download:
youtube-dl -i -a test.txt5. How to update youtube-dl, enter the following command to perform the update:
pip install --upgrade youtube-dlThe setup here is done using youtube-dl. If you need to play videos from the VPS server online, you can build various video CMS systems for playback, or you can build a personal network disk for online playback.
Reference documentation
- https://www.sysgeek.cn/youtube-dl-examples
- https://pwner.cn/posts/fa0684f3.html
- https://www.jianshu.com/p/6bae57859325
- https://www.jianshu.com/p/611009843919
- https://ubuntuqa.com/article/9770.html
Recommended site search: anti-complaint vps host, Taiwan online proxy server, website domain name registration, forum registration, website registration how long, Japanese server rental Japanese server, permanent free space, telecommunications ip agent, Japanese proxy server ip, domain name space Agent,
发表评论