MacOS – Downloading YouTube music videos

macossoftware-recommendationvideoyoutube

Is there a reliable YouTube video converter than can download music videos?

I am a professor teaching overseas and often download music videos for classroom use. For example, gospel songs and Christmas songs for my Intro to the Bible course.

ClipConverter use to download both talking and musical vids, but now blocks musical videos.

Best Answer

If you use command-line (Terminal.app in macOS) or even if you have a passing familiarity with it, youtube-dl is a highly recommended tool.

youtube-dl is available for macOS, Windows as well as Linux. The usage is very simple, just type the following command-line in Terminal (I have used an example video for demonstration purposes. Replace the URL with the appropriate one as desired):

youtube-dl https://www.youtube.com/watch?v=dgxpBpa9A48

That's it. It will download the video in the best available quality. There are no ads or any questionable content involved. Also there is no risk of downloading any inadvertent software/malware. youtube-dl downloads videos at best available speed for your Internet connection (unlike many other tools). It also supports download resuming (helpful if the connection breaks midway).

youtube-dl is not a built-in command in macOS. The easiest and best way to install it would be via using Homebrew. Follow the instructions on the linked webpage to install Homebrew. Once installed, run the following command to install youtube-dl:

brew install youtube-dl

Using youtube-dl, you can also easily download the video in lower resolution (for e.g. to watch on mobile device or to share over messenger) or just the audio only or video only stream from the video.

To select the download quality or type, simply, execute the command with an additional -F option to list all the available formats as:

youtube-dl -F https://www.youtube.com/watch?v=dgxpBpa9A48

The output will show all the available formats as:

[youtube] dgxpBpa9A48: Downloading webpage
[youtube] dgxpBpa9A48: Downloading video info webpage
[youtube] dgxpBpa9A48: Extracting video information
[info] Available formats for dgxpBpa9A48:
format code  extension  resolution note
249          webm       audio only DASH audio   50k , opus @ 50k, 3.19MiB
250          webm       audio only DASH audio   79k , opus @ 70k, 4.87MiB
171          webm       audio only DASH audio  112k , vorbis@128k, 6.98MiB
140          m4a        audio only DASH audio  128k , m4a_dash container, mp4a.40.2@128k, 8.70MiB
251          webm       audio only DASH audio  143k , opus @160k, 9.06MiB
278          webm       236x144    144p   83k , webm container, vp9, 30fps, video only, 2.79MiB
160          mp4        236x144    144p  129k , avc1.4d400c, 30fps, video only, 5.18MiB
242          webm       394x240    240p  188k , vp9, 30fps, video only, 4.55MiB
133          mp4        394x240    240p  271k , avc1.4d400d, 30fps, video only, 11.95MiB
243          webm       590x360    360p  347k , vp9, 30fps, video only, 8.06MiB
134          mp4        590x360    360p  487k , avc1.4d401e, 30fps, video only, 9.38MiB
244          webm       786x480    480p  508k , vp9, 30fps, video only, 13.20MiB
247          webm       1180x720   720p  910k , vp9, 30fps, video only, 25.75MiB
135          mp4        786x480    480p  957k , avc1.4d401f, 30fps, video only, 18.18MiB
302          webm       1180x720   720p60 1561k , vp9, 60fps, video only, 28.76MiB
136          mp4        1180x720   720p 1806k , avc1.4d401f, 30fps, video only, 36.16MiB
298          mp4        1180x720   720p60 1973k , avc1.4d4020, 60fps, video only, 37.02MiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        320x194    small , mp4v.20.3, mp4a.40.2
18           mp4        592x360    medium , avc1.42001E, mp4a.40.2@ 96k
43           webm       640x360    medium , vp8.0, vorbis@128k
22           mp4        1180x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

To download the desired variant, simply pass the mentioned format code with -f option, and that particular audio/video stream will be downloaded and saved. For e.g., execute the following command-line to download the medium sized variant, suitable for playback on mobile devices:

youtube-dl -f 18 https://www.youtube.com/watch?v=dgxpBpa9A48

There are many more advanced options like looking up available subtitle files and downloading a specific one. The aforementioned options should suffice for casual usage.

Note: youtube-dl supports downloading from over a 1000 popular streaming websites like Vimeo, Dailymotion etc. apart from YouTube. youtube-dl can be easily installed using Homebrew.