Downloading Video/Audio Content Off Of Websites

[home]

The Problem

YouTube download websites are terrible, they are full of adverts trying to get you to buy stupid things, pop ups are everywhere, they are all around just a headache to have to deal with. Thankfully yt-dlp and mpv solve this issue.

mpv is a media player and it is very extensible and minimal. You can listen to music watch movies etc etc with mpv but in addition with yt-dlp we can watch videos straight from the internet without having to watch through the web browser.

yt-dlp allows us to download video/audio content off of the internet. You may of heard of youtube-dl, yt-dlp is the continuation of youtube-dl. yt-dlp works on many different site, of the sites I have tried, we can use yt-dlp on YouTube, Invidious, Dailymotion and BBC Iplayer and I imagine many more.


What You Will Need

You will need to download and install both yt-dlp and mpv, both these tools can be found in most if not all package manager repos. You will likely only need to install mpv as yt-dlp is included with mpv.


The Solution

Downloading videos off of websites with yt-dlp

If all we want to do is download videos to our hard drive off of a website like YouTube all we need to do is simply run a command like this:

yt-dlp https://www.youtube.com/watch?v=ZZj6cfus2h4

This will download the video straight to the hard drive. If you want to download a playlist of videos, supplying the link to the playlist will download all of the videos from the playlist.

NOTE: I have only tried the playlist part with YouTube and Invidious so I don't know how it would react to a site like BBC Iplayer.

Downloading audio off of websites with yt-dlp

In order to download audio only we must supply yt-dlp with some extra arguments. It is a simple as this:

yt-dlp --extract-audio --audio-format wav https://www.youtube.com/watch?v=ZZj6cfus2h4

Of course replace the audio format with whatever you like for example mp3.

Again we can replace the video link with a playlist link and it will just download all the videos in the playlist as audio only files, this is very useful if you want to download massive playlists of all your tunes.

Watching videos without downloading them with mpv + yt-dlp

As mpv is a media player and works well with yt-dlp, we can quite easily watch videos straight from the internet without downloading them to the disk , it is as simple as this:

mpv https://www.youtube.com/watch?v=ZZj6cfus2h4

This will use yt-dlp to get the video and feed it to mpv. We can replace the link with a playlist or any video/audio file on your computer.