How to download videos from youtube on Linux and Mac

I wanted to edit a video I found on youtube.  Since I have a  Macbook Pro with iMovie Editing software I decided to start there.

Naturally when I don’t know something  I Google for the answers.  There were a couple of posts that lead me to some tutorials on youtube.

Approach #1 is to download RealPlayer SP with RealPlayer Downloader and RealPlayer Converter.  Which I did, installed all this stuff on my MacBook  and downloaded the Movie clip.

Result: the downloaded clip just played black.  (No this isn’t a typo.  The resultant video was BLACK for the entire clip) I installed a newer version of Flash player which did not help.  Finally I uninstalled all the realvideo stuff.

Approach #2 Was to d/l another program called mytube widget.  I took at look at the downloaded files and asked myself if I wanted to install all this “junk” on my Mac.  I thought there has to be another way.

Approach #3 At this point I thought perhaps I can do this on a Linux box since there are several at home here.  Turns out you can easily install youtube-dl

(Debian and its derivatives # apt-get install youtube-dl)

Fedora # yum install youtube-dl

Mac (Do this in terminal)

# sudo curl -o /usr/local/bin/youtube-dl
# sudo chmod a+x /usr/local/bin/youtube-dl

This apparently will work in Windows also but you need to download a Python interpreter.  This comes with OSX and Linuxes.

This is a python script.  So all you do is

a) Get the youtube URL that you want.  The easiest way is to startup a browser and copy the youtube URL.

b) % youtube-dl -F “<desiredyoutubevideourl>

It will list a number formats .  Here’s an example:

171         webm      audio only  DASH webm audio , audio@ 48k (worst)
140         m4a       audio only  DASH audio , audio@128k
160         mp4       192p        DASH video
133         mp4       240p        DASH video
17          3gp       176×144     
36          3gp       320×240     
5           flv       400×240     
43          webm      640×360     
18          mp4       640×360     (best)

Now just pick the format you want and download the video, E.G.

% usr/local/bin/youtube-dl -f 18 “”

Now you get your video in the format you want you can just redisplay it or edit it.

I suppose that Mac (and Windows) people are just afraid of the command line.  I believe it far easier to run a simple script in a terminal than to have several megabyte downloads and converters that don’t even work in a GUI.  But of course YMMV.

Oh yes.  My edited video.  I was trying to make a point on why Microsoft likes developers.  You can see the results here






How to download videos from youtube on Linux and Mac — 2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *