Click Technology

Linux, Windows, Mac it's all good

YouTube Downloading

May15

I’ve been using

youtube-dl

for ages now and use it to download videos, podcasts and playlists I want to listen to offline. To install it on Linux, just use

sudo apt-get install youtube-dl

Once in, all that’s needed is the URL you want to download, and, once you have it, you just use it like this..

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

Simple.

But the video in this case is a three hour podcast, so that ends up being around 3GB. A lot. Can we get a smaller version?

Yes. Use the -F switch to list all the available audio/video and audio only formats..

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

You get this..

user@host $ youtube-dl -F https://youtu.be/USg3NR76XpQ
[youtube] USg3NR76XpQ: Downloading webpage
[youtube] USg3NR76XpQ: Downloading video info webpage
[youtube] USg3NR76XpQ: Extracting video information
[youtube] USg3NR76XpQ: Downloading MPD manifest
[info] Available formats for USg3NR76XpQ:
format code  extension  resolution note
249          webm       audio only DASH audio   55k , opus @ 50k, 64.26MiB
139          m4a        audio only DASH audio   58k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 60.43MiB
250          webm       audio only DASH audio   73k , opus @ 70k, 79.10MiB
171          webm       audio only DASH audio  110k , vorbis@128k, 125.32MiB
140          m4a        audio only DASH audio  137k , m4a_dash container, mp4a.40.2@128k (44100Hz), 161.38MiB
251          webm       audio only DASH audio  139k , opus @160k, 147.56MiB
160          mp4        256x144    DASH video  148k , avc1.4d400c, 30fps, video only, 42.91MiB
278          webm       256x144    144p  154k , webm container, vp9, 30fps, video only, 119.24MiB
242          webm       426x240    240p  278k , vp9, 30fps, video only, 154.07MiB
133          mp4        426x240    DASH video  282k , avc1.4d4015, 30fps, video only, 136.58MiB
243          webm       640x360    360p  469k , vp9, 30fps, video only, 346.58MiB
134          mp4        640x360    DASH video  610k , avc1.4d401e, 30fps, video only, 204.77MiB
244          webm       854x480    480p  856k , vp9, 30fps, video only, 673.62MiB
135          mp4        854x480    DASH video 1024k , avc1.4d401f, 30fps, video only, 521.78MiB
247          webm       1280x720   720p 1729k , vp9, 30fps, video only, 1.79GiB
136          mp4        1280x720   DASH video 1875k , avc1.4d401f, 30fps, video only, 1.20GiB
248          webm       1920x1080  1080p 3188k , vp9, 30fps, video only, 3.58GiB
137          mp4        1920x1080  DASH video 3569k , avc1.640028, 30fps, video only, 3.06GiB
17           3gp        176x144    small , mp4v.20.3, mp4a.40.2@ 24k
36           3gp        320x180    small , mp4v.20.3, mp4a.40.2
43           webm       640x360    medium , vp8.0, vorbis@128k
18           mp4        640x360    medium , avc1.42001E, mp4a.40.2@ 96k
22           mp4        1280x720   hd720 , avc1.64001F, mp4a.40.2@192k (best)

This extensive list of options allows you to pick a preferred format. I’m going to go for option 139

139          m4a        audio only DASH audio   58k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 60.43MiB

which is a more manageable 60MB. Let’s download that.

youtube-dl -f 139 https://www.youtube.com/watch?v=USg3NR76XpQ

Nice. Job done.

posted under Linux Tips

Email will not be published

Website example

Your Comment:

This is my website for short blog posts and interesting materials that are noteworthy or have some handy-tip value.